Skip to content

Instantly share code, notes, and snippets.

@vipulbhj
Created November 23, 2018 18:49
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 vipulbhj/05a89376ce0f8b9265989b678fd05c54 to your computer and use it in GitHub Desktop.
Save vipulbhj/05a89376ce0f8b9265989b678fd05c54 to your computer and use it in GitHub Desktop.
Basic Node JS server using http module.
const http = require('http');
const PORT = process.env.PORT || 5000;
const app = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write("Hello World");
res.end();
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
@vipulbhj
Copy link
Author

http gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment