Last active
January 26, 2018 05:19
-
-
Save makersm/94593eacc61fabff2aca6adb2c622a7e to your computer and use it in GitHub Desktop.
https server
This file contains 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 app = require('express')(); | |
const privatekey = fs.readFileSync('PRIV_FILE_PATH'); | |
const certificate = fs.readFileSync('CERT_FILE_PATH'); | |
const credentials = {key: privatekey, cert: certificate}; | |
const port = PORT_NUM; | |
https.createServer(credentials, app).listen(port, () => { | |
console.log(`http server start with ${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment