express-group-routing
v1.0.0
Published
## Quick Start
Downloads
66
Readme
Simple Route Grouping in Express using express-group-routing
Quick Start
If you want to prefix all routes with a certain URL, you can use the group
method as follows:
import express from 'express';
import group from 'express-group-routing';
const router = express.Router();
router.group('/api/v1', (router) => {
router.get('/login', loginController.store); // /api/v1/login
});
In the example above, the group method allows you to easily group routes under the specified prefix (/api/v1 in this case). The nested router within the group function can then have routes defined relative to the specified prefix.
Feel free to explore more features and options provided by express-group-routing to efficiently organize your Express routes.