Created
April 9, 2023 08:35
-
-
Save syafiqfaiz/242b30c31ceef4c7e9528529c26a1a59 to your computer and use it in GitHub Desktop.
Simple Server with just node js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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