From f9007758619429f1b4805e6abd0e5564184b039c Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Mon, 7 Oct 2024 12:58:47 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20server:=20serve=20static=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/index.ts b/server/index.ts index 997d2185..4bd1d4db 100644 --- a/server/index.ts +++ b/server/index.ts @@ -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" });