Shamoon Shamoon - 1 year ago 64
Node.js Question

How can I send back response headers with Node.js / Express?

I'm using

and no matter what, it returns status of 200. I want to set that status to different numbers for different responses (Error, etc)

This is using

Answer Source
res.writeHead(200, {'Content-Type': 'text/event-stream'});