const http = require("node:http"); const listProducts = () => {}; const getProduct = () => {}; const routes = { GET: { "/products": listProducts, "/products/:id": getProduct, }, }; const server = http.createServer((req, res) => { const { headers ,url, method } = req; console.log({ headers, url, method, }); res.writeHead(200, { "Content-Type": "text/plain", }); res.end("Hello, web!\n"); }); const app = udsPath => { server.listen(udsPath, () => { console.log("I'm web."); }); }; module.exports = { app, };