Monday 24 April 2017

[Express] 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?

Submitted April 25, 2017 at 01:57AM by TheLegendOfCode

No comments:

Post a Comment