Skip to content

Instantly share code, notes, and snippets.

@tanepiper

tanepiper/bar.js Secret

Created August 16, 2012 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanepiper/2a6b048209589efd5090 to your computer and use it in GitHub Desktop.
Save tanepiper/2a6b048209589efd5090 to your computer and use it in GitHub Desktop.
server.mount(function(req) {
if ( !req.modified_request && /\/s.gif|\/s.json/.test(req.url) === true ) {
return true;
}
return false;
}, function(req, bounce) {
req.modified_request = true;
var url = 'http://' + req.headers.host + '/pb' + req.url;
console.log(req);
bounce(url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment