express-group-routes

1.1.0 • Public • Published

Express group routes

Simple way to group your routes in Express.

Quick start

If you want to prefix all routes with a certain URL you can use the group method as following:

var app = require('express');
require('express-group-routes');
 
app.group("/api/v1", (router) => {
    router.get("/login", loginController.store); // /api/v1/login 
});

In case you don't want to add a prefix but still need to group certain routes you can leave the first parameter and go straight for the function:

var app = require('express');
require('express-group-routes');
 
app.group((router) => {
    router.use(middleware);
});

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    1,184
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    1,184
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i express-group-routes

Weekly Downloads

1,186

Version

1.1.0

License

MIT

Last publish

Collaborators

  • dirkgroenen