Skip to content

Instantly share code, notes, and snippets.

@timoxley
Forked from framlin/gist:2317972
Created April 6, 2012 08:47
Show Gist options
  • Save timoxley/2318250 to your computer and use it in GitHub Desktop.
Save timoxley/2318250 to your computer and use it in GitHub Desktop.
flatiron ip address middleware
var union = require('union');
var flatiron = require('flatiron');
var winston = require('winston');
var ecstatic = require('ecstatic');
app = new flatiron.App();
app.use(flatiron.plugins.http);
app.http.before = [
function (req, res) {
app.log.info("REQ - hello client" + req.socket.remoteAddress);
res.emit('next');
},
ecstatic(__dirname + '/../site')
];
app.start(8081);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment