Code Monkey home page Code Monkey logo

Comments (7)

shekohex avatar shekohex commented on May 15, 2024

Hi @thaoula 😀

Actually The RouterModule Should Work as Expected with the new Version of Nest v5

I also added an example to demonstrate that it works as usual
check it here

and about your issue I also added a LoggerMiddleware that works like a charm.
see it also LoggerMiddleware

from nest-router.

thaoula avatar thaoula commented on May 15, 2024

Hi @shekohex,

Really appreciate getting back to me and thanks for the example.

I was getting -

image

Then I changed forRoutes("*") to forRoutes("/") like you example and now it works.

Regards,
Tarek

from nest-router.

shekohex avatar shekohex commented on May 15, 2024

Glad it works.
Happy Coding 😄 !

from nest-router.

thaoula avatar thaoula commented on May 15, 2024

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.

from nest-router.

shekohex avatar shekohex commented on May 15, 2024

Imo, i think because of this note

move from traditional express middleware model: each middleware is solely bounded to a particular path, regardless of the request method.

Nest Now not only supporting Express Middleware Model, Actually the design had to be changed to work well with new Adapters.
but anyway i think by just setting a global middleware in the root module. it should catch all routes, did you try this ? give it a shot.

from nest-router.

johnbendi avatar johnbendi commented on May 15, 2024

@shekohex your Note link is broken!

from nest-router.

shekohex avatar shekohex commented on May 15, 2024

@johnbendi
Thanks, Comment updated :)

from nest-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.