Skip to content

The open-source app everyone uses to manage agents at work

fix(server): serve cached index.html in SPA catch-all to prevent 500

Matt Van Horn0f32fffe797b
diff --git a/server/src/app.ts b/server/src/app.ts
index d663654f36..b21ec39f34 100644
--- a/server/src/app.ts
+++ b/server/src/app.ts
@@ -134,9 +134,10 @@ export async function createApp(
];
const uiDist = candidates.find((p) => fs.existsSync(path.join(p, "index.html")));
if (uiDist) {
+ const indexHtml = fs.readFileSync(path.join(uiDist, "index.html"), "utf-8");
app.use(express.static(uiDist));
app.get(/.*/, (_req, res) => {
- res.sendFile("index.html", { root: uiDist });
+ res.status(200).set("Content-Type", "text/html").end(indexHtml);
});
} else {
console.warn("[paperclip] UI dist not found; running in API-only mode");