Skip to content

Instantly share code, notes, and snippets.

@techbyvideo
Created September 22, 2016 14:49
Show Gist options
  • Select an option

  • Save techbyvideo/3f2d38f998b7fa72b04ba8d7325985b0 to your computer and use it in GitHub Desktop.

Select an option

Save techbyvideo/3f2d38f998b7fa72b04ba8d7325985b0 to your computer and use it in GitHub Desktop.
//Library to create a web server
var http = require('http');
// Create your HTTP server
var server = http.createServer(function(request, response){
//Sends a response header to the request
response.writeHead(200, {'Content-Type': 'text/plain'});
//This method signals to the server that all of the response headers and body have been sent
response.end('TechByVideo, Hello World\n');
});
//server will be listen this port 3002
server.listen(3002, function(){
console.log('TechByVideo, Example app listening on port 3002!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment