Skip to content

Add warning in doc when in use with Express in regards to use and METHOD functions #5

@morgaan

Description

@morgaan
router.use('/events', (req, res, next) => {
    console.dir(req.originalUrl) // '/naturecareers/events'
    console.dir(req.baseUrl) // '/naturecareers/events'
    console.dir(req.path) // '/'
  next();
});

router.get('/events', (req, res, next) => {
    console.dir(req.originalUrl) // '/naturecareers/events'
    console.dir(req.baseUrl) // '/naturecareers'
    console.dir(req.path) // '/events'
  next();
});

See how use drop the path. This lead to issue the backend being invoked with / rather than /events

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions