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.

Revisions

  1. techbyvideo created this gist Sep 22, 2016.
    20 changes: 20 additions & 0 deletions server.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    //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!');
    });