koa-decorator-router
Decorator Routing
Install
npm i koa-decorator-router -S
const app = const router = const route = const middleware1 = @ @ @middleware1 { ctxbody = `detail ` } @ { ctxbody = 'add' } @ { ctxbody = 'post' } @ { ctxbody = 'del' } routeapp app
Api
- controller
methods
- get
- put
- post
- all
- convert
- required
Route
setRouterPath
Set the location of the import routing folder and import filesinit
Functions for mounting routingsetRouterPathAndInit
Import routing file and automatically initialize after completion
routeapp app
or
{ await route route app app}