diff --git a/mod.ts b/mod.ts index 6997eed..42aa386 100644 --- a/mod.ts +++ b/mod.ts @@ -1,5 +1,5 @@ // Import necessary modules from dependencies -import { cors, oak, parse, path, } from "./deps.ts"; +import { cors, oak, parse, path } from "./deps.ts"; import { twoslasher } from "./vendor/twoslash.ts"; import type { TwoSlashOptions } from "./vendor/twoslash.ts"; @@ -28,7 +28,7 @@ const router = new Router(); // Define routes router // Root route - .get("/", async (context) => { + .get("/(index)?(.html)?", async (context) => { // Use the send function from oak to serve static files // This is similar to express.static in Express.js await send(context, "/index.html", { diff --git a/script/build.ts b/script/build.ts index 9749c31..6994da7 100644 --- a/script/build.ts +++ b/script/build.ts @@ -1,4 +1,4 @@ -import { getDocs } from "../docs.tsx"; +import { getDocs } from "./docs.tsx"; import { path } from "../deps.ts"; // Destructure necessary path utilities from path (similar to path in Node.js) diff --git a/docs.tsx b/script/docs.tsx similarity index 96% rename from docs.tsx rename to script/docs.tsx index 81296e9..3f10b88 100644 --- a/docs.tsx +++ b/script/docs.tsx @@ -10,7 +10,7 @@ import { withHtmlInMarkdown, withShiki, GithubMarkdownFlavor, -} from "./deps.ts"; +} from "../deps.ts"; // Destructure necessary path utilities from path (similar to path in Node.js) const { dirname, fromFileUrl, join } = path; @@ -35,7 +35,7 @@ export async function getDocs() { .use(toHtml) // Serialize HTML syntax tree; .process( new TextDecoder().decode( - await Deno.readFile(join(__dirname, "./README.md")), + await Deno.readFile(join(__dirname, "../README.md")), ), );