Skip to content

Instantly share code, notes, and snippets.

@ShinyChang
Last active February 12, 2019 16:28
Show Gist options
  • Save ShinyChang/d5cd25cc77ef9dbe45901e05306ec45f to your computer and use it in GitHub Desktop.
Save ShinyChang/d5cd25cc77ef9dbe45901e05306ec45f to your computer and use it in GitHub Desktop.
require('dotenv').config();
const https = require('https');
const path = require('path');
const fs = require('fs');
const Express = require('express');
const app = new Express();
app.get('/', (req, res) => res.send('Hello World!!'));
const options = {
key: fs.readFileSync(path.join(__dirname, 'localhost-key.pem')),
cert: fs.readFileSync(path.join(__dirname, 'localhost.pem'))
};
server = https.createServer(options, app);
server.listen(process.env.PORT || 443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment