Created
May 2, 2018 10:44
-
-
Save akbarsahata/853c614d7044e2849d48f94f2897a3f5 to your computer and use it in GitHub Desktop.
implementation of HTTPS in Node.JS
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
const https = require('https') | |
const path = require('path') | |
const fs = require('fs') | |
const app = require('../app.js') | |
const option = { | |
cert: fs.readFileSync(path.join(__dirname, 'fullchain.pem')), | |
key: fs.readFileSync(path.join(__dirname, 'privkey.pem')), | |
} | |
const server = https.createServer(option, app) | |
server.listen(443, () => { | |
console.log('server secure has started') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment