Skip to content

Instantly share code, notes, and snippets.

@vodolaz095
Created September 4, 2013 09:40
Show Gist options
  • Save vodolaz095/6434863 to your computer and use it in GitHub Desktop.
Save vodolaz095/6434863 to your computer and use it in GitHub Desktop.
expressJS example for waterfall style routing
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