- Bridge: Express API server with SQLite (projects, tasks, executions, outputs) - Dashboard: Next.js app rewired from WebSocket gateway to Tiger Bridge HTTP API - Tasks: Kanban board with drag-drop, project management with CRUD - Dispatch: Task dispatch to sandbox with file watcher for status updates - UI: Container health panel, workspace browser, logs viewer, output viewer Critical fixes: - Use execInSandbox instead of execOnHost for container operations - Watch symlink path instead of container-internal path - URL-encoded params for GET requests instead of body - PUT/DELETE support added to useBridgeRequest Sprints 1-5 complete. Ready for VPS deployment.
53 lines
No EOL
1.6 KiB
TypeScript
53 lines
No EOL
1.6 KiB
TypeScript
/**
|
|
* /api/tiger/projects/[id] — Single project proxy
|
|
*
|
|
* GET, PUT, DELETE for a specific project.
|
|
*/
|
|
|
|
import { NextResponse } from "next/server";
|
|
import { bridgeGet, bridgePost, bridgeDelete } from "@/lib/bridge";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET(
|
|
request: Request,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const { id } = await params;
|
|
try {
|
|
const result = await bridgeGet(`/tiger/projects/${id}`);
|
|
return NextResponse.json(result);
|
|
} catch (err: unknown) {
|
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
return NextResponse.json({ ok: false, error: message }, { status: 502 });
|
|
}
|
|
}
|
|
|
|
export async function PUT(
|
|
request: Request,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const { id } = await params;
|
|
try {
|
|
const body = await request.json();
|
|
const result = await bridgePost(`/tiger/projects/${id}`, body);
|
|
return NextResponse.json(result);
|
|
} catch (err: unknown) {
|
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
return NextResponse.json({ ok: false, error: message }, { status: 502 });
|
|
}
|
|
}
|
|
|
|
export async function DELETE(
|
|
request: Request,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const { id } = await params;
|
|
try {
|
|
const result = await bridgeDelete(`/tiger/projects/${id}`);
|
|
return NextResponse.json(result);
|
|
} catch (err: unknown) {
|
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
return NextResponse.json({ ok: false, error: message }, { status: 502 });
|
|
}
|
|
} |