-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nest Router in V5 #8
Comments
Hi @thaoula 😀 Actually The I also added an example to demonstrate that it works as usual and about your issue I also added a |
Hi @shekohex, Really appreciate getting back to me and thanks for the example. I was getting - Then I changed forRoutes("*") to forRoutes("/") like you example and now it works. Regards, |
Glad it works. |
Actually, do you mind explaining the difference between forRoutes("*") and forRoutes("/"). Our application has a number of middleware registered like this. It would be great to understand why it worked in V4 and not V5. |
Imo, i think because of this note
Nest Now not only supporting Express Middleware Model, Actually the design had to be changed to work well with new Adapters. |
@shekohex your |
@johnbendi |
Hi @shekohex,
Do you know if the nest-router package works in V5?
We are are trying upgrade application and we are having issues in our authentication middleware.
In v4, req.path = the full relative path to an item eg /api/private/users
In v5, req.path = "/"
resolve(...excluded: Route[]): FunctionMiddleware {
return (req, res, next) => {
const isExcluded = excluded.filter(route => {
let excluedPath = route.path == req.path;
return excluedPath
}).length > 0;
}}
Not sure if this is a Nest issue or a router issue.
Regards,
Tarek
The text was updated successfully, but these errors were encountered: