Skip to content

Instantly share code, notes, and snippets.

@hatched
Created December 6, 2012 04:14
Show Gist options
  • Save hatched/4221727 to your computer and use it in GitHub Desktop.
Save hatched/4221727 to your computer and use it in GitHub Desktop.
npm install lactate
var http = require('http'),
port = 2424,
lactate = require('lactate'),
publicDir = lactate.dir('/public');
var server = http.createServer(function(req, res) {
if (req.url === '/') {
return publicDir.serve('index.html', req, res);
} else {
return publicDir.serve(req, res);
}
});
server.listen(port, function() {
console.log('Listening on port', port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment