Add explicit route for SPA at root path to serve index.html

This commit is contained in:
Evandro Fonseca Junior committed 2025-11-21 23:51:52 -03:00
1 parent 2c6df8186b
commit b9ca713a2a
1 file changed
+5
+5
View File
@@ -27,6 +27,11 @@ await app.register(fastifyStatic, {
index: ["index.html"],
});
// Rota explícita para a SPA na raiz, útil especialmente em ambientes de deploy.
app.get("/", (_request, reply) => {
return reply.sendFile("index.html");
});
app.get("/health", async () => {
return { status: "ok" };
});