public
Created — forked from timoxley/index.js

flatiron ip address middleware

  • Download Gist
index.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
var union = require('union');
var flatiron = require('flatiron');
var ecstatic = require('ecstatic');
 
 
app = new flatiron.App();
app.use(flatiron.plugins.http);
 
app.http.before = [
function (req, res) {
//this logs >> info: REQ - hello clientundefined
app.log.info("REQ - hello client" + req.socket);
res.emit('next');
},
ecstatic(__dirname + '/../site')
];
 
app.start(8081);
 
 
// HEERE is the tail -f output:
 
 
arn: Forever detected script exited with code: null
warn: Forever restarting script for 5 time
 
info: REQ - hello clientundefined
info: REQ - hello clientundefined
info: REQ - hello clientundefined
info: REQ - hello clientundefined
info: REQ - hello clientundefined
info: REQ - hello clientundefined

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.