Last active
February 12, 2019 16:28
-
-
Save ShinyChang/d5cd25cc77ef9dbe45901e05306ec45f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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