forked from EduCraft/curriculum-project-hub
fix(admin): serve built SPA and include it in release builds
registerStaticSpa was never mounted, so production only exposed org-admin APIs. Wire it after auth/API routes, fold admin:build into npm run build, and install admin-web deps during deploy so admin-web/build ships with the release for same-origin /admin/*.
This commit is contained in:
@@ -70,9 +70,9 @@ export async function registerStaticSpa(app: FastifyInstance): Promise<void> {
|
||||
}
|
||||
});
|
||||
|
||||
// SPA client-side route fallback. `/admin/login` is registered earlier as a
|
||||
// static route and takes precedence; everything else under /admin/* serves
|
||||
// the index so SvelteKit's client-side router can resolve the view.
|
||||
// SPA client-side route fallback. Auth registers `/admin/login` first so it
|
||||
// takes precedence; everything else under /admin/* serves the index so
|
||||
// SvelteKit's client-side router can resolve the view.
|
||||
app.get("/admin", async (_request, reply) => {
|
||||
return reply.type("text/html; charset=utf-8").send(indexHtml);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user