Skip to content

Instantly share code, notes, and snippets.

@jcrugzz
Created March 28, 2013 16:42
Show Gist options
  • Save jcrugzz/5264781 to your computer and use it in GitHub Desktop.
Save jcrugzz/5264781 to your computer and use it in GitHub Desktop.
var http = require('http');
var ecstatic = require('ecstatic')(__dirname + '/public');
var bunyan = require('bunyan');
var log = bunyan.createLogger({
name: 'myapp',
stream: process.stdout,
level: 'info'
});
http.createServer(function (req, res) {
if (req.url === '/test') {
log.info(req.headers);
log.info('o hai');
res.setHeader('content-type', 'text/plain');
res.end('test 123');
}
else ecstatic(req, res);
}).listen(3000, function () {
log.info('Listening on Port 3000');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment