import { createServer } from "node:http";
import { env } from "./shared/env.js";
import { createRequestHandler } from "./server/request-handler.js";

const handler = createRequestHandler();

const server = createServer((req, res) => {
  void handler(req, res);
});

server.listen(env.port, env.host, () => {
  console.log(`mapix listening on http://${env.host}:${env.port}`);
});

