From fabc7c78f714d154144d6a3c2dfeb0ea63ca7bab Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 7 Mar 2026 23:24:27 +0000 Subject: [PATCH] fix: add web search stub and API catch-all for demo deployment - Add /api/web-search stub returning empty results in demo mode - Add /aiui/api/* catch-all returning JSON 404 instead of HTML fallback - Fix nginx proxy to catch all /api/ routes (not just /aiui/api/web-search) Co-Authored-By: Claude Opus 4.6 --- neode-ui/docker/nginx-demo.conf | 4 ++-- neode-ui/mock-backend.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/neode-ui/docker/nginx-demo.conf b/neode-ui/docker/nginx-demo.conf index 2c918631..68d26294 100644 --- a/neode-ui/docker/nginx-demo.conf +++ b/neode-ui/docker/nginx-demo.conf @@ -78,8 +78,8 @@ http { } } - # Proxy AIUI API requests (web-search, claude) to backend - location /aiui/api/web-search { + # Proxy AIUI API requests (web-search, etc.) to backend + location /api/ { proxy_pass http://neode-backend:5959; proxy_http_version 1.1; proxy_set_header Host $host; diff --git a/neode-ui/mock-backend.js b/neode-ui/mock-backend.js index 8e560485..df3a3192 100755 --- a/neode-ui/mock-backend.js +++ b/neode-ui/mock-backend.js @@ -1078,6 +1078,16 @@ app.post('/aiui/api/claude/*', (req, res) => { proxyReq.end() }) +// Web search stub (no search engine configured in demo) +app.get('/api/web-search', (req, res) => { + res.json({ results: [], error: 'Web search not available in demo mode' }) +}) + +// AIUI API catch-all for unimplemented endpoints (return JSON instead of HTML) +app.all('/aiui/api/*', (req, res) => { + res.status(404).json({ error: 'Not found' }) +}) + // Health check app.get('/health', (req, res) => { res.status(200).send('healthy')