router = express.Router(); // use router with prefix app.use( "/rest", auth, router ); router.get( "/:table", function( req, res ) { res.send( "Request: " + req.params.table ); }); router.get( "/:table/:id", function( req, res ) { res.send( req.params ); }); app.get( "/", function( req, res ) { console.log( "req" ); res.send( "Hello World" ); }); app.listen( 80 ); Node.js – from the Beginning express 22-Apr-16