Skip to content

Instantly share code, notes, and snippets.

@reggi
Last active December 10, 2015 17:08
Show Gist options
  • Save reggi/4465538 to your computer and use it in GitHub Desktop.
Save reggi/4465538 to your computer and use it in GitHub Desktop.
app.use(function(req, res, next) {
req.url = req.url.replace("/cat","");
next();
});
app.use(app.router);
// `/` and `/cat`
app.get('/', function(req, res, next) {
res.send('index');
});
// `/hello` and `/cat/hello`
app.get('/hello', function(req, res, next) {
res.send('hello');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment