Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get router() {
if (this[ROUTER]) {
return this[ROUTER];
}
const router = this[ROUTER] = new Router({ sensitive: true }, this);
// register router middleware
this.beforeStart(() => {
this.use(router.middleware());
});
return router;
}
private createEggRouter(controllerOption: ControllerOption) {
const { prefix, routerOptions: { sensitive } } = controllerOption;
if (prefix) {
const router = new Router({ sensitive }, this.app);
router.prefix(prefix);
return router;
}
return null;
}