Created
January 14, 2020 17:48
-
-
Save olegpolyakov/0cb6cebe5c2838bb7af4371359f5af71 to your computer and use it in GitHub Desktop.
HTTP Express Server with SSL
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 fs = require('fs'); | |
const https = require('https'); | |
const ssl = { | |
key: fs.readFileSync(__dirname + '/ssl/certificate.pem'), | |
cert: fs.readFileSync(__dirname + '/ssl/certificate.crt') | |
}; | |
https.createServer(ssl, server).listen(server.get('port'), () => { | |
console.log('Express server listening on port ' + server.get('port')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment