Shamoon Shamoon - 1 year ago 79
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'});

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download