NestMiddleware support asynchronous methods
See original GitHub issueIt would be awesome if NestMiddleware
could support
export interface NestMiddleware {
resolve(...args: any[]): Promise<Express.RequestHandler> | Express.RequestHandler;
}
by checking to see if they are returning a promise and awaiting them.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
how can nest middleware support asynchronous ... - GitHub
I custom a middleware as follow: @Injectable() export class LoginMiddleware implements NestMiddleware { constructor (private readonly ...
Read more >NestJS How to consume async middleware? - Stack Overflow
You can absolutely use asynchronous middleware with Nest; however, there is a problem with using the .forRoutes({path: 'path', method: ...
Read more >Middleware | NestJS - A progressive Node.js framework
Nest middleware fully supports Dependency Injection. ... Hint The configure() method can be made asynchronous using async/await (e.g., you can await ...
Read more >Learn Nest.js Middleware - JT Earl - Medium
You can implement Nest middleware as a class or in a function (also known ... Finally, we can also apply middleware to specific...
Read more >Multi Tenancy with NestJS async-hooks | fabianskii
Async_hooks can be used to track asynchronous resources, and will help with tracking the current tenant therefore.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @StrikeForceZero, It’s possible since v4. Enjoy! 🐱
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.