Created
September 4, 2013 09:40
-
-
Save vodolaz095/6434863 to your computer and use it in GitHub Desktop.
expressJS example for waterfall style routing
This file contains 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 characters
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res){ | |
res.send('hello world, this is route 1'); | |
}); | |
app.get('/', function(req, res){ | |
res.send('hello world, this is route 2'); | |
}); | |
app.listen(3000); | |
//this example shows, that route 1 ALWAYS overlap route 2 | |
/* | |
so, with kabam kernel we can do it, to overlap catch all route | |
kabam.extendRoutes(function(kernel){ | |
app.all('*', function(req, res){ | |
//do something | |
}); | |
}); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment