Skip to content

Commit 0509a83

Browse files
committed
feat: 開発サーバーのルーティングを改善
1 parent 4a43a18 commit 0509a83

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

website/src/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Hono } from "hono";
2+
import { appendTrailingSlash, trimTrailingSlash } from "hono/trailing-slash";
23
import {
34
CategoryTemplate,
45
HtmlTemplate,
@@ -18,6 +19,11 @@ const docs = docsJson as unknown as Page[];
1819
const [flattenedPages, pagePaths] = flattenDocs(docs);
1920

2021
const app = new Hono();
22+
app.use(appendTrailingSlash());
23+
app.use(trimTrailingSlash());
24+
app.get("/", (c) => {
25+
return c.redirect("/docs");
26+
});
2127

2228
flattenedPages.forEach((page, pageIndex) => {
2329
const path = pagePaths[pageIndex];

0 commit comments

Comments
 (0)