Open
Description
Hi There
In typescript-express-example/src/index.ts you have some beautifully elegant code:
`
// register all application routes
AppRoutes.forEach(route => {
app[route.method](route.path, (request: Request, response: Response, next: Function) => {
route.action(request, response)
.then(() => next)
.catch(err => next(err));
});
});
`
That registers all applications routes.
If you enable
"strict": true
in the tsconfig.json I get the error:
src/index.ts:19:4 - error TS7017: Element implicitly has an 'any' type because type 'Express' has no index signature. 19 app[route.method](route.path, (request: Request, response: Response, next: Function) => { ~~~~~~~~~~~~~~~~~
Is there a way to combine modules in this elegant way and enable strict?
Kind regards
Metadata
Metadata
Assignees
Labels
No labels