Last active
November 30, 2015 07:26
-
-
Save nanusdad/873638dc53785f7a1f11 to your computer and use it in GitHub Desktop.
Starting https service with Node / Express module
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
var fs = require('fs'); | |
var express = require('express'); | |
var securityOptions = { | |
key: fs.readFileSync('/certs/domain.com.key'), | |
cert: fs.readFileSync('/certs/domain.com.chained.crt'), | |
requestCert: true | |
}; | |
// ....................................................... | |
// create the secure server (HTTPS) | |
var app = express(); | |
var secureServer = require('https').createServer(securityOptions, app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment