You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matt Edelman edited this page Apr 13, 2015
·
8 revisions
Define a module that exports a function that returns a router
//in path/to/controllervarexpress=require('express');module.exports=function(){varrouter=express.Router();// path in `require`s below will be relative to this filerouter.get('/login',require('./path/to/loginMiddleware'));router.post('/login',require('./path/to/loginPostMiddleware'));router.get('/some/other/route',require('./path/to/otherRouteMiddleware'));returnrouter;}
Include the router module in <env>.json's middleware section