Skip to content

Instantly share code, notes, and snippets.

@pquerna
Created August 31, 2012 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pquerna/f29c23a007623a5d08ff to your computer and use it in GitHub Desktop.
Save pquerna/f29c23a007623a5d08ff to your computer and use it in GitHub Desktop.
var express = require('express'),
spdy = require('spdy'),
https = require('https'),
base = null,
options = null,
secure = null,
sServ = null,
fs = require('fs');
options = {
key: fs.readFileSync('/etc/ssl/journal.key'),
cert: fs.readFileSync('/etc/ssl/journal.crt'),
ca: fs.readFileSync('/etc/ssl/journal-ca.crt')
};
function addContent(app) {
app.use(express.logger());
app.use("/", express.static(__dirname + '/_site'));
}
base = express();
secure = express();
addContent(base);
addContent(secure);
sServ = spdy.createServer(https.Server, options, secure);
base.listen(80);
sServ.listen(443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment