diff --git a/bin/game.tsx b/bin/game.tsx index 3a2e446..e5e5e4b 100644 --- a/bin/game.tsx +++ b/bin/game.tsx @@ -4,7 +4,7 @@ export const game = true import type { GameContext, InputState } from "@/shared/game" -import { rng } from "@/shared/utils.ts" +import { rng } from "@/shared/utils" const WIDTH = 960 const HEIGHT = 540 diff --git a/bin/snake.ts b/bin/snake.ts index 60e7fd1..d697e2e 100644 --- a/bin/snake.ts +++ b/bin/snake.ts @@ -2,7 +2,7 @@ export const game = true import type { GameContext, InputState } from "@/shared/game" -import { rng } from "@/shared/utils.ts" +import { rng } from "@/shared/utils" const CELL = 20 const WIDTH = 30 diff --git a/bin/tetris.ts b/bin/tetris.ts index 6cc7638..461e540 100644 --- a/bin/tetris.ts +++ b/bin/tetris.ts @@ -7,7 +7,7 @@ export const game = true import type { GameContext, InputState } from "@/shared/game" -import { randomElement, randomIndex } from "@/shared/utils.ts" +import { randomElement, randomIndex } from "@/shared/utils" const COLS = 10 const ROWS = 20 diff --git a/src/server.tsx b/src/server.tsx index c627c87..eb0b881 100644 --- a/src/server.tsx +++ b/src/server.tsx @@ -42,10 +42,10 @@ app.use("*", async (c, next) => { }) app.on("GET", ["/js/:path{.+}", "/shared/:path{.+}"], async c => { - const path = "./src/" + c.req.path.replace("..", ".") + let path = "./src/" + c.req.path.replace("..", ".") // path must end in .js or .ts - if (!path.endsWith(".js") && !path.endsWith(".ts")) return c.text("File not found", 404) + if (!path.endsWith(".js") && !path.endsWith(".ts")) path += ".ts" const ts = path.replace(".js", ".ts") if (isFile(ts)) {