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 Oct 31, 2024
1 parent 217cb6a commit f900775
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 f900775

Please sign in to comment.