❮ HTTP
❯
- http
- createServer
- listen
HTTP Hello World
examples/http/http_hello_world.js
const http = require('http'); // A subclass of the emitter const server = http.createServer((req, res) => { if (req.url === '/') { res.write('Hello World'); res.end(); } }); const port = 3000; server.listen(port); console.log(`Listening on port ${port}`);