···11-export { serve } from "https://deno.land/std@0.218.2/http/server.ts";
21import html, { h } from "https://deno.land/x/htm@0.2.1/mod.ts";
32export { html, h };
43import dayjs from "npm:dayjs";
+11-5
main.tsx
···11/** @jsx h */
22-import { serve, html, h, cyan } from "./deps.ts";
22+import { html, h, cyan } from "./deps.ts";
33import { styles } from "./src/styles.ts";
44import { links } from "./src/links.ts";
55import { footer } from "./src/footer.tsx";
···2424 ),
2525 });
26262727-serve(handler, {
2828- onListen: () =>
2929- console.log(`Server started on ${cyan("http://localhost:8000")} 🚀`),
3030-});
2727+const port = Deno.env.get("PORT") ? Number(Deno.env.get("PORT")) : 8000;
2828+2929+Deno.serve(
3030+ {
3131+ port,
3232+ onListen: () =>
3333+ console.log(`Server started on ${cyan(`http://localhost:${port}`)} 🚀`),
3434+ },
3535+ handler
3636+);