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

181
Views
Express.js Routing wrong route

I have 3 express.js routes

app.get('/packages/:name', (req, res) => {...});
app.get('/packages/search/', (req, res) => {...});
app.get('/packages/search/:name', (req, res) => {...});

The first and thrid routes are working just fine. But the second route is never triggert. When I browse to "localhost/packages/search/" it will trigger the first route with res.params.name = "search/"

I can do an "if" to check if its "search/" but i don't think thats a good solution.

Am I doing something wrong?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Routes in express.js are executed in order.

For detail Node.js Express route naming and ordering: how is precedence determined?

about 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!