opticore-router v1.0.10
OptiCore Router Module
It is a Router module that allow to create a route for your feature module by two ways
Install
npm i opticore-router-module
Usage
single router using
method
: you can define your method here as post or put or get or delete.
path
: set the path here
handler
: At this line, handler is a function which receive the controller method
middleware
: you can set true if you want to use any auth middleware, so you should define a strategy name and set the Options as an object same likely IAuthPassportOptions if you want it.
OpticoreRouterModule.route("delete", "/ads", () => {}, true, "jwt", {session: true});
multiple routers using
method
: you can define your method here as post or put or get or delete.
myController
: represent the controller that you want to use
routers
: is an array which must contains a route object like this { path: "/ads", handler: () => {} }
middleware
: can get auth middleware or null as value
OpticoreRouterModule.routes(myController, [ { path: "/ads" , handler: context => {} }], null);
Security Issues
https://github.com/guyzoum77/opticore-router/issues
Contributing
OptiCore Router Module is an Open Source, so if you would like to contribute, you're welcome. Clone repository and open pull request.
About
OptiCore Router Moduleis led by Guy-serge Kouacou and supported by Guy-serge Kouacou