Socket
Book a DemoInstallSign in
Socket

express-cascade-routes

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-cascade-routes

Cascade Express routes in a directory hierarchy

0.1.6
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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)

FAQs

Package last updated on 08 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.