SyntaxFix
Write A Post
Hire A Developer
Questions
You can directly set the content type like below:
res.writeHead(200, {'Content-Type': 'text/plain'});
For reference go through the nodejs Docs link.