Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

196
Vistas
Get request not found, attempt to set ?value parameters inside a url

I did this get, with the intention of returning the amount of clients that the application needed, but insomnia only returns that it didn't find the route:

server.get('/consultclients?amount=1', (req,res) =>{
let amount = req.params.amount;

return res.json({amount})
})

Request insomnia: localhost:3003/consultclients?amount=10

I tried with a method that I used to search for an id, but I don't think it's the right method to use, even though it works:

server.get('/consultclients/:amount', (req,res) =>{
let amount = req.params.amount;

return res.json({amount})
})

Request insomnia: localhost:3003/consultclients/10

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Try the base path .get('/consultclients', …), and then see if req.query.amount (req.query instead of req.params) is populated when you make your request.

about 4 years ago · Santiago Trujillo Denunciar

0

You are trying to access the search params. You can find them in the req.query in the request object instead of the req.params

This code example should work for you:

server.get('/consultclients', (req,res) =>{
  let amount = req.query.amount;

  return res.json({amount})
})
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda