Skip to content

Commit fec5dab

Browse files
feat(routing): enforce trailing slash for consistency in route matching
1 parent 1bb0a13 commit fec5dab

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

server/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createClient, Client } from "@libsql/client";
22
import { Hono } from "hono";
33
import { cors } from "hono/cors";
4+
import { appendTrailingSlash } from "hono/trailing-slash";
45

56
const app = new Hono();
67

@@ -15,6 +16,7 @@ app.use(
1516
allowMethods: ["POST"],
1617
}),
1718
);
19+
app.use(appendTrailingSlash());
1820

1921
app.get("*", async ({ env }, next) => {
2022
if (!globalThis.tursoClient) {
@@ -29,7 +31,7 @@ app.get("*", async ({ env }, next) => {
2931
await next();
3032
});
3133

32-
app.get("/track", async (c) => {
34+
app.get("/track/", async (c) => {
3335
try {
3436
const turso = globalThis.tursoClient;
3537
if (!turso) throw new Error("Turso Client is not Initialized");

0 commit comments

Comments
 (0)