Skip to content

Commit

Permalink
✨ server: serve static app
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo committed Nov 11, 2024
1 parent dbc2d9e commit 236ab80
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ app.get("/.well-known/assetlinks.json", (c) =>
},
]),
);
app.use(
"/*",
serveStatic({
root: "app",
rewriteRequestPath: (path) => {
if (path.endsWith("/")) return `${path}/index.html`;
if (path.includes(".")) return path;
return `${path}.html`;
},
}),
);

app.onError((error, c) => {
captureException(error, { level: "error" });
Expand Down

0 comments on commit 236ab80

Please sign in to comment.