0.1.6 • Published 10 years ago

express-cascade-routes v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Cascade Express routes in a directory hierarchy

If the current directory has routes to add, as well as subdirectories with routes, build up your index.js as follows:

var cascadeRoutes = require('express-cascade-routes');
var express = require('express');
var router = express.Router();
router.route('/someRoute').post(function(req, res) {
    // ...
});
router.use('/', cascadeRoutes(__dirname));
module.exports = router;

If the current directory has no routes, but needs to cascade routes contained in subfolders, just place an index.js with the following:

module.exports = require('express-cascade-routes')(__dirname)
0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago