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
Rest API on express. Parameter passing

Folks, I need your expert advice: I have two endpoints on my node server using express:

'/api/status/:id'
'/api/status/all'

Now both have different purpose. One returns one status by Id and other one is all statuses. But express seems to be taking both request as the first one hence it is breaking on cast error. any help please.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can define '/api/status/all' before '/api/status/:id' and if request will match to all it will be handled with that middleware.

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!