Skip to content

Instantly share code, notes, and snippets.

@jaredchu
Created June 6, 2021 08:05
Show Gist options
  • Save jaredchu/ecd6f1bb8632bb51ad521984b36b4dbc to your computer and use it in GitHub Desktop.
Save jaredchu/ecd6f1bb8632bb51ad521984b36b4dbc to your computer and use it in GitHub Desktop.
Node.js test index file
const http = require('http');
const hostname = '';
const port = 4000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment