Closed SwagiWagi closed 2 months ago
Hello there SwagiWagi 👋
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.👀
I assume you are using Express, there is two way to archive such feature.
Call middleware after response sent in Express
AfterMiddleware
decorator.
but I doubt the necessity of it right now.cc @WoH need your opinion.
(req, res, next) => {
next()
console.log('post')
}
Should do it, right?
I believe an AfterMiddleware decorator would be a great feature. It's great for use cases such as:
I believe it wouldn't be much work, I can make a PR for this.
(req, res, next) => { next() console.log('post') }
Should do it, right?
Yes, just call next() in custom template, after L106 would work with after middleware.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Sorry to bring up a dead issue. But this doesn't appear to have been implemented.
I'm happy to do the PR if needed, or maybe there is discussion elsewhere as to why this wasn't added?
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce
@Route("user") export class UserController extends Controller { @Middlewares(validateUserId) @Get("{userId}") async getUser(@Path() userId: string) { this.setStatus(200); return {userId: userId}; } }
Now I want a logging middleware to be called (for example), specifically after the response has been sent.
Context (Environment)
Version of the library: 6.1.5 Version of NodeJS: 20.11.0
Detailed Description
Breaking change?