Monday 12 June 2017

Node Express JS - Handling simultaneous POST requests to the server

I have a node project implementing express to handle incoming GET/POST requests, I have created routes to handle different kinds of requests. I have a route as /api/twitter/search which basically calls a function that uses promises to fetch twitter feeds and sends the data in response using response.write

Now the situation here is, when I make two simultaneous requests to the same route with the same input data, then somehow the results of both the requests coincide giving inconsistent response. I want any number of requests to the server to be handled separately, even if the action to the request has a number of async calls/promises in place.

Can anyone please help me here. I am totally new to js development, so any help will be appreciated



via kushagra jaiswal

No comments:

Post a Comment