express-tree
Hierarchical (almost-declarative) routing for express.js
Plant
npm i express-tree --save
var express = require('express');
require('express-tree');
var app = express();
Pluck
app.tree({
'': function(req, res) {
res.send('hello forest.')
},
login: 'login',
account: {
'': 'account/index',
register: 'account/register',
settings: [ logged, 'account/settings' ],
},
'POST login': passport.authenticate('local', {
successRedirect: '/',
failureRedirect: '/login',
failureMessage: true,
badRequestMessage: ''
})
});