Last active
December 10, 2015 17:08
-
-
Save reggi/4465538 to your computer and use it in GitHub Desktop.
Revisions
-
reggi revised this gist
Jan 6, 2013 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,16 @@ 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'); }); -
defunctzombie created this gist
Jan 6, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ app.use(function(req, res, next) { req.url = '/cat' + req.url; next(); }); app.use(app.router); app.get('/cat/foo', function(req, res, next) { res.send('hello'); });