Skip to content

Commit

Permalink
✨ server: serve static app
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo authored and dieguezguille committed Nov 4, 2024
1 parent 46aab3c commit b2fb91d
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 b2fb91d

Please sign in to comment.