I'm using busboy with express.js 4 and node.js to receive via an HTTP POSTa set of field values and an uploaded file from a form in the browser.  The file will then be processed (data extracted, new documents created in the database etc.) with the possibility of some of the updates not being successful.  What I want to do is update the user what is going on during the processing and then the outcome when all is done.
To do this I want to use HTML5 server sent events. Before some suggests it, I can't use websockets.
When I declare:
var eventSource = new EventSource('/API/upload');
in my browser I see an HTTP GET on the server to this URL.  What I want is for eventSource to listen for server sent events from the HTTP POST handler, the route that receives and processes the uploaded metadata and file.  My expectation was that in my app.post(... handler I could put:
res.writeHead(200, {
  'Content-Type': 'text/event-stream',
  'Cache-Control': 'no-cache',
  'Connection': 'keep-alive'
});
res.write('\n');
and then push down status updates using:
res.write(message'\n\n');
res.flush(); // I'm using compression
finally terminating the exchange with res.status(200).end(); after all the processing, updating etc. is done.  But of course the browser isn't listening for that EventSource, it's listening for one on the GET route
So, how can I:
- configure the browser with an EventStreamobject that doesn't automatically make aGETrequest when I instantiate it?
- and instead listen for events being sent back from the POSTevent handler on the server?
 
     
    