mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-06 10:48:12 +02:00
fix(server): return 404 JSON for unmatched API routes
Add catch-all handler after API router to return a proper 404 JSON response instead of falling through to the SPA handler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
9ac2e71187
commit
db15dfaf5e
1 file changed
+3
@@ -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") {
|
||||
|
||||
Reference in new issue
Block a user