0

I have a route defined as:

router.get('/console/:labID?', (req, res, next) => {

When this route gets called, all additional requests are appended to /console to give you a request similar to :

/console/<new request>

I'm assuming this is intended functionality and I need to reset the route somewhere based on the request? Occasionally I will want to append it but where do I control this behavior?

gbam
  • 1,454
  • 4
  • 18
  • 30
  • 1
    Are you looking for `res.redirect()` http://expressjs.com/en/api.html#res.redirect? – jsalonen Aug 05 '17 at 23:25
  • @jsalonen - I just realized why I this wasn't working as I don't have a leading slash on my requests... Reading through that pointed that out to me... Thanks! – gbam Aug 05 '17 at 23:27
  • Seems to me that you might be looking for "relative URLs" and "root-relative URLs": https://stackoverflow.com/questions/2005079/absolute-vs-relative-urls#answer-39545949 – jsalonen Aug 05 '17 at 23:32

0 Answers0