Skip to content

Instantly share code, notes, and snippets.

@HussainArif12
Last active April 25, 2020 06:44
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 HussainArif12/14abf0cf1b31fb8edb214b6e3c3a531b to your computer and use it in GitHub Desktop.
Save HussainArif12/14abf0cf1b31fb8edb214b6e3c3a531b to your computer and use it in GitHub Desktop.
var http = require('http');
const port = 3000
//create a server object:
http.createServer(function (req, res) {
res.writeHead(200,{'Content-Type':'text/html',
'Content-Length':body.length})
res.write('Hello World!'); //write a response to the client
res.end(); //end the response
})
.listen(port); //the server object listens on port 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment