feat: Graphify build worker endpoints + UI trigger
- POST /api/aos/instances/[id]/graph-build: trigger or get build command - POST /api/aos/instances/[id]/graph-status: worker callback (ok/error) - GET /api/aos/graphify-health: check if Graphify service is up - Instance detail: 'Graph neu erstellen' button (visible when demo_active/active) - Graceful degradation: if GRAPHIFY_URL not set, returns build command for external worker
This commit is contained in:
1 parent
7d94fe53ad
commit
25599a5516
4 files changed
+301
-9
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { createGraphifyClientFromEnv } from '@/lib/graphify'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
// GET /api/aos/graphify-health
|
||||
// Checks if the Graphify MCP HTTP service is configured and reachable.
|
||||
// Used by the instance detail UI to show whether graphify is available.
|
||||
export async function GET() {
|
||||
const url = process.env.GRAPHIFY_URL
|
||||
if (!url) {
|
||||
return NextResponse.json({
|
||||
configured: false,
|
||||
ok: false,
|
||||
message: 'Graphify not configured (GRAPHIFY_URL missing)',
|
||||
})
|
||||
}
|
||||
|
||||
const client = createGraphifyClientFromEnv()
|
||||
if (!client) {
|
||||
return NextResponse.json({ configured: true, ok: false, message: 'client init failed' })
|
||||
}
|
||||
|
||||
const health = await client.health()
|
||||
return NextResponse.json({
|
||||
configured: true,
|
||||
ok: health.ok,
|
||||
url,
|
||||
version: health.version,
|
||||
message: health.ok ? 'Graphify service is up' : 'Graphify service unreachable',
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user