Add explicit route for SPA at root path to serve index.html
This commit is contained in:
1 parent
2c6df8186b
commit
b9ca713a2a
1 file changed
+5
@@ -27,6 +27,11 @@ await app.register(fastifyStatic, {
|
|||||||
index: ["index.html"],
|
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 () => {
|
app.get("/health", async () => {
|
||||||
return { status: "ok" };
|
return { status: "ok" };
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user