I have followed the tutorial from:
But I do not find a way to inject dynamic parameters in @UseBefore/@UseAfter middleware call Like this:
@Get("/something/:id")
@UseBefore(checkPermission(['canReadThis','canWriteThis']))
getOne(@Param("id") id: number) {
// ...
}
Can someone gide me doing this?
I found this :
But I dont know how to handle data from the Context "Class" and "{req, resp, next}" like this
function loggingMiddleware(request: any, response: any, next?: (err?: any) => any): any {
console.log('do something...');
next();
}