Intercept H3 Response Body (Plus Types?) #1392
-
Now, the plugin I want to create requires I append something to the body of the response. Here is what was done in express. How do I replicate in H3/Nitro const originalSend = res.send; |
Beta Was this translation helpful? Give feedback.
Answered by
Hebilicious
Jul 5, 2023
Replies: 1 comment 2 replies
-
Would the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think that your only option is a middleware, altough, they run globally before your logic. We do have some features coming that will enable the ability to run code after an event handler has returned, but in the meantime I also added a proposal that could allow you to do that #1396
However, if you need to do this now, you can do it with a custom nitro preset #1373