Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
express js route with optional parameters :different path always points to same function

I've two routes in my express js app

1.router.route('/art/:category/:fieldName/:tag/:count(\\d+)?/:perPage(\\d+)?')

2.router.route('/art/search/:keyword/:count(\\d+)?/:perPage(\\d+)?')

when i access the second route like(art/search/fu/1/1) its always point to route-1

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In your route file place route2 before route 1, since you manage /art/:category before /art/search express assume that search is a category. That's why it point to route 1 and not route 2.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!