Skip to content

Instantly share code, notes, and snippets.

@creationix
Created January 4, 2011 05:13
Show Gist options
  • Save creationix/764421 to your computer and use it in GitHub Desktop.
Save creationix/764421 to your computer and use it in GitHub Desktop.
creationix.com with new node unstable https apis.s
var secure = __dirname + "/secure/";
var handler = require('stack')(
require('creationix/log')(),
require('creationix/auth')(/^\/secure\//, require(secure + "users.js")),
require('creationix/static')("/", __dirname, "index.html")
);
var read = require('fs').readFileSync;
var options = {
key: read(secure + "creationix.key"),
cert: read(secure + "certificate.pem")
};
require('http').createServer(handler).listen(8000);
require('https').createServer(options, handler).listen(8433);
console.log("Server listening at http://creationix.com:8000/");
console.log("Server listening at https://creationix.com:8433)");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment