express-group-routing

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i express-group-routing

Weekly Downloads

37

Version

1.0.0

License

ISC

Unpacked Size

1.26 kB

Total Files

3

Last publish

Collaborators

  • ebrunkn