Skip to content

Commit 12a272e

Browse files
dawidclaude
andcommitted
Fix 404 Not Found error for Ingress dashboard access
The issue was that Home Assistant Ingress routes to root (/) but the dashboard was only available on /mcp-dashboard, causing 404. Changes: - Serve dashboard HTML directly on root route (/) for Ingress - Keep /mcp-dashboard route for backwards compatibility - Extract dashboard HTML into reusable function - Fix syntax error in HTML template Now both Ingress access and direct URL access work properly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 39cdb23 commit 12a272e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

dashboard/api/server.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ app.use(cors({
2323
}));
2424
app.use(express.json());
2525

26-
// Serve a simple dashboard page for both root and /mcp-dashboard
26+
// Serve dashboard directly on root for Ingress
2727
app.get('/', (req, res) => {
28-
res.redirect('/mcp-dashboard');
28+
res.send(getDashboardHTML());
2929
});
3030

31+
// Also serve on /mcp-dashboard for backwards compatibility
3132
app.get('/mcp-dashboard', (req, res) => {
32-
res.send(`
33+
res.send(getDashboardHTML());
34+
});
35+
36+
function getDashboardHTML() {
37+
return `
3338
<html>
3439
<head><title>Claude MCP Dashboard</title></head>
3540
<body>
@@ -53,7 +58,7 @@ app.get('/mcp-dashboard', (req, res) => {
5358
</script>
5459
</body>
5560
</html>
56-
`);
61+
`;
5762
});
5863

5964
// Configuration

0 commit comments

Comments
 (0)