Skip to content

Instantly share code, notes, and snippets.

Last active November 8, 2016 13:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
HTTPS static file server with connect
var connect = require('connect');
var serveStatic = require('serve-static');
var https = require('https');
// Get certificates for free here
var key = fs.readFileSync('./key.pem');
var cert = fs.readFileSync('./cert.pem')
var options = {
key: key,
cert: cert
var port = 443;
var folder = __dirname;
var app = connect();
https.createServer(options, app).listen(port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment