Created
August 13, 2018 11:22
-
-
Save codenirvana/3f8d9b9f68d193de1126990ee1691cde to your computer and use it in GitHub Desktop.
Node.js Dump Raw HTTP Response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const server = http.createServer(); | |
server.on('connection', (socket) => { | |
socket.end(`HTTP/1.1 204 No Content | |
Content-Length: 12 | |
Content-Type: text/plain | |
Hello World!`); | |
}); | |
server.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment