Skip to content

Instantly share code, notes, and snippets.

@syafiqfaiz
Created April 9, 2023 08:35
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 syafiqfaiz/242b30c31ceef4c7e9528529c26a1a59 to your computer and use it in GitHub Desktop.
Save syafiqfaiz/242b30c31ceef4c7e9528529c26a1a59 to your computer and use it in GitHub Desktop.
Simple Server with just node js
var http = require('http');
//create a server object:
http.createServer(function (req, res) {
res.write('Hello World!'); //write a response to the client
res.end(); //end the response
}).listen(5000); //the server object listens on port 8080
// Console will print the message
console.log('Server running at 5000');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment