is there I way to run code after response? having access to req and res context? #3055
Answered
by
NicoPlyley
leognmotta
asked this question in
Q&A
-
I need a way to run some code after we have finished some operation and are ready to send response, is it possible? |
Beta Was this translation helpful? Give feedback.
Answered by
NicoPlyley
Jun 28, 2024
Replies: 1 comment 3 replies
-
Hi @leognmotta, |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
leognmotta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @leognmotta,
I think what you are looking for the middleware, you will have access to the context as well. In middleware everything after
await next()
will run after the controller returns a responses and before it sent to the client take a look at the docs here