2024-12-29 23:00:38 -05:00
|
|
|
import { serveDir, serveFile } from "jsr:@std/http/file-server";
|
|
|
|
|
|
|
|
Deno.serve((req: Request) => {
|
|
|
|
const pathname = new URL(req.url).pathname;
|
|
|
|
|
|
|
|
if (pathname.startsWith("/static")) {
|
|
|
|
return serveDir(req, {
|
2025-01-05 22:17:30 -05:00
|
|
|
fsRoot: "static",
|
2024-12-29 23:00:38 -05:00
|
|
|
urlRoot: "static",
|
|
|
|
});
|
|
|
|
} else {
|
2025-01-05 22:17:30 -05:00
|
|
|
return serveFile(req, "static/index.html");
|
2024-12-29 23:00:38 -05:00
|
|
|
}
|
|
|
|
});
|