We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Thank you for adding in the flexibility to support standard functions as middleware!
However noticed this error when trying to use a function that returns a middleware function e.g.
export const testMiddlewareFunc = (test: string) => { return async (req, res, next) => { console.log(test); next(); }; }; @Controller("/TestDecorator", [ async (req: Request, res: Response, next: NextFunction) => { console.log("log controller middleware"); next(); }, testMiddlewareFunc("123") ]) export class TestDecoratorController { @Get("/:id", [ async (req: Request, res: Response, next: NextFunction) => { console.log("package log route middleware"); next(); } ])
And I get this error
Which I think originates from here - https://github.com/serhiisol/node-decorators/blob/master/express/src/middleware.ts#L67
Is it possible to add this flexibility?
Thanks
The text was updated successfully, but these errors were encountered:
Hi @markkelsall. Nice catch, I'll take a look asap
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hi,
Thank you for adding in the flexibility to support standard functions as middleware!
However noticed this error when trying to use a function that returns a middleware function e.g.
And I get this error
![image](https://user-images.githubusercontent.com/10911327/214905778-1c9ea0a2-f5c4-47e4-831e-da35176d9b84.png)
Which I think originates from here - https://github.com/serhiisol/node-decorators/blob/master/express/src/middleware.ts#L67
Is it possible to add this flexibility?
Thanks
The text was updated successfully, but these errors were encountered: