Created
July 31, 2021 17:19
-
-
Save sitek94/df724d5040d349dee259e0eb0486e38e to your computer and use it in GitHub Desktop.
Simple Node.js Server
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
const http = require('http'); | |
const port = 5000; | |
const ip = '165.227.151.233'; | |
const server = http.createServer((req, res) => { | |
console.log('There was a request!'); | |
res.writeHead(200); | |
res.write('Hello from Simple NodeJS Server!'); | |
res.end(); | |
}); | |
server.listen(port, () => { | |
console.log(`Listening on port: ${port}`); | |
console.log(`http://${ip}:${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment