import http from 'node:http'; const server = http.createServer((req, res) => { if (req.url === '/health') { res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); return res.end(JSON.stringify({ ok: true })); } res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); res.end('Hello Node.js'); }); const port = process.env.PORT || 3000; server.listen(port, () => console.log(`listening on http://localhost:${port}`));