0.1.6 • Published 8 years ago

express-cascade-routes v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
8 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

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago