Skip to content

Instantly share code, notes, and snippets.

@sitek94
Created July 31, 2021 17:19
Show Gist options
  • Save sitek94/df724d5040d349dee259e0eb0486e38e to your computer and use it in GitHub Desktop.
Save sitek94/df724d5040d349dee259e0eb0486e38e to your computer and use it in GitHub Desktop.
Simple Node.js Server
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