Skip to content

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

fix(server): return 404 JSON for unmatched API routes

Dottadb15dfaf5eaa
diff --git a/server/src/app.ts b/server/src/app.ts
index 1faab2852e..5ce4e29297 100644
--- a/server/src/app.ts
+++ b/server/src/app.ts
@@ -121,6 +121,9 @@ export async function createApp(
}),
);
app.use("/api", api);
+ app.use("/api", (_req, res) => {
+ res.status(404).json({ error: "API route not found" });
+ });
const __dirname = path.dirname(fileURLToPath(import.meta.url));
if (opts.uiMode === "static") {