Skip to content

Instantly share code, notes, and snippets.

@oleksiiBobko
Created July 20, 2016 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleksiiBobko/b0b986852650a57e8142b45a7faf4c44 to your computer and use it in GitHub Desktop.
Save oleksiiBobko/b0b986852650a57e8142b45a7faf4c44 to your computer and use it in GitHub Desktop.
server
#!/usr/bin/env node
var http = require("http");
var server = http.createServer(function(request, response) {
console.log('-------------------------');
console.log(request.headers);
request.on('data', function(chunk) {
console.log("Received body data:");
console.log(chunk.toString());
});
response.writeHead(200, {"Content-Type": "text/html"});
response.write("");
response.end();
});
server.listen(5000);
console.log("Server is listening");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment