Express 4 router documentation
var adminRouter = express.Router()
adminRouter.use('/', ensureAdmin)
adminRouter.route('/users')
.get(formRoute)
.post(genericRoute)
adminRouter.get('/accounts`', genericRoute)
adminRouter.get('/transactions', genericRoute)
var authRouter = express.Router()
authRouter.get('/sign_in', genericRoute)
authRouter.get('/sign_out', genericRoute)
authRouter.get('/register', genericRoute)
var coreAppRouter = express.Router()
coreAppRouter.get('/widgets', genericRoute)
coreAppRouter.get('/tasks', genericRoute)
app.use('/admin', adminRouter)
app.use('/auth', authRouter)
app.use('/app', coreAppRouter)