Last active
February 5, 2018 08:39
-
-
Save vickonrails/02229737ea19f0f6bf1d4b63fc0874a8 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
//server.js | |
const express = require('express'), | |
https = require('https'), | |
http = require('http'), | |
fs = require('fs'), | |
app = express(); | |
//credentials obtained from a Certificate Authority | |
var options = { | |
key: fs.readFileSync('/path/to/key.pem'), | |
cert: fs.readFileSync('/path/to/cert.pem') | |
}; | |
//Binding the app on different ports so the app can be assessed bt HTTP and HTTPS | |
http.createServer(app).listen(80); | |
https.createServer(options, app).listen(443); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment