question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NestMiddleware support asynchronous methods

See original GitHub issue

It 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilmysliwieccommented, Sep 12, 2017

Hi @StrikeForceZero, It’s possible since v4. Enjoy! 🐱

0reactions
lock[bot]commented, Sep 25, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found