Skip to content

Commit

Permalink
fix: correct extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Ringrose committed Jul 26, 2024
1 parent 28c1e80 commit d1843d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/reactSSR/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const router = new Router();
router.use(logger(console.log));

// SSR, with cache because static page
router.get("/", cacher(), reactHandler(Home, "Peko", "/src/pages/Home.ts"));
router.get("/", cacher(), reactHandler(Home, "Peko", "/src/pages/Home.tsx"));

// SSR, no cache because dynamic content
router.get(
"/about",
reqTime,
reactHandler(About, "Peko | About", "/src/pages/About.ts")
reactHandler(About, "Peko | About", "/src/pages/About.tsx")
);

// Static, URL param for filename, always cache
Expand All @@ -28,7 +28,7 @@ router.get("/assets/:filename", cacher(), (ctx) =>
// Transformed src at build-time with esbuild, always cache
router.get("/src/:dirname/:filename", cacher(), (ctx) =>
githubHandler(
`/dist/${ctx.params.dirname}/${ctx.params.filename.replace(".ts", ".js")}`,
`/dist/${ctx.params.dirname}/${ctx.params.filename.replace(".tsx", ".js")}`,
"application/javascript"
)(ctx)
);
Expand Down

0 comments on commit d1843d3

Please sign in to comment.