Skip to content

Instantly share code, notes, and snippets.

@craftgear
Created October 11, 2011 12:26
Show Gist options
  • Save craftgear/1277950 to your computer and use it in GitHub Desktop.
Save craftgear/1277950 to your computer and use it in GitHub Desktop.
bouncy_test.js
var bouncy = require('bouncy');
bouncy(function(req, bounce){
if (req.headers.host === 'localhost' ){
console.log(req.headers.host)
bounce(3000);
}
else{
var res = bounce.respond();
res.write('error: bounce nowhere');
res.end();
}
}).listen(80);
@craftgear
Copy link
Author

executed Express server on port 3000
executed bouncy "sudo node bouncy_test.js"
access http://localhost/ shows a Express top page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment