// Hilmacorp — page « en construction » (www.hilmacorp.ca) // Auteur : Simon-Pierre Boucher / contact@spboucher.ai import http from "node:http"; import { readFileSync } from "node:fs"; import { join, dirname } from "node:path"; import { fileURLToPath } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); const PORT = Number(process.argv[2] || process.env.PORT || 8070); const html = readFileSync(join(__dirname, "public", "index.html")); const started = new Date().toISOString(); http.createServer((req, res) => { const url = (req.url || "/").split("?")[0]; if (url === "/healthz") { res.writeHead(200, { "content-type": "application/json" }); return res.end(JSON.stringify({ ok: true, app: "hilmacorp-ca", started })); } if (url === "/robots.txt") { res.writeHead(200, { "content-type": "text/plain" }); return res.end("User-agent: *\nDisallow:\n"); } res.writeHead(url === "/" || url === "/index.html" ? 200 : 404, { "content-type": "text/html; charset=utf-8", "cache-control": "no-cache", }); res.end(html); }).listen(PORT, "0.0.0.0", () => console.log(`hilmacorp-ca listening on :${PORT}`));