How to create and use custom middleware? #1023
Unanswered
Zhuravlev1
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Hey @Zhuravlev1, |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to implement custom middleware with a connection to DB using Prisma. My AppModule is:
LoggerMiddleware:
LoggerModule:
It starts without errors and code reaches my logger middleware but then I am getting an error:
I have access to Prisma service from another provider and a connection to DB works. At the start, nest initializes all dependencies successfully and returns a result from db if call
logger.use({}, () => {})
like this:I don't understand why during execution it fell with this error. What did I do wrong? looks like my custom middleware doesn't have dependencies
Beta Was this translation helpful? Give feedback.
All reactions