Skip to main content

EcoRouter

EcoRouter is a class responsible for registering routes to KoaJS runtime.

Static Method​

Create Router​

createRouter([opt]) ⇒ KoaRouter

Creates a new instance of KoaRouter with the provided options.

Return: A new instance of KoaRouter

Available arguments :

ParameterTypeDescription
[opt]RouterOptionsOptional options to configure the router.

Properties​

ParameterTypeDescription
systemRouterKoaRouter | undefinedRepresents a KoaRouter instance that handles system routes.
apiRouterKoaRouterThe API router instance for handling API routes in the application.

TypeScript Properties​

tip

The Router is an inherited instance of koa-router and a more appropriate can be found here