What is it ?
This will help to create express routes and keep it organized.
Motivation
I love to to keep my code splitted, and this is a nice way to manage it and to not get lost
while making all the routes and to keep it clean !
How to use ?
Install the package
npm install express-routes-manager-v1
lets imagine you have a class with some routes :
{ super } static routes: Route = path: '/' action: 'index' verb: 'get' path: '/user' action: 'getUser' verb: 'get' path: '/delete' action: 'deleteUsers' verb: 'delete' path: '/update' action: 'updateUsers' verb: 'patch' path: '/comment' action: 'commentUser' verb: 'post' private { // do something } private { // do something } private { // do something } private { // do something } private { // do something }
Somewhere else in your code where you manage your server config :
const router = const mains = const connectedRoutes = MainRoutes; const others = const connecteOthersRoutes = SomeOtherRoutes;
In another file to boot the server
const app = app app
CONTRIBUTING
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.