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

239
Vistas
Unable to process same GET request multiple times. How do I get around this?

I'm making a Node.JS app where the user sends commands to a robot. These requests are received from Angular.JS $http.get() requests. This is what the code looks like server side:

app.get('/control/:dir/:amount', function(req, res){
    var dir = req.params.dir.substring(1);
    var amount = req.params.amount.substring(1);
    networking.sendCommand(dir, amount);
});

I know everything is sent properly, but it can only process a certain request once (so no matter how many time localhost:8080/control/forward/100 is sent, it only gets processed once). Is there any way around this?

Edit: The error was fixed by changing app.get() to app.post() and adding a res.sendStatus(200) back to the client.

about 4 years ago · Santiago Trujillo
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