- Add CLAUDE.md at root and AGENTS.md in apps/api, apps/indexer, apps/backoffice, crates/parsers with module-specific guidelines - Unify all service ports to 70XX (no more internal/external split): API 7080, Indexer 7081, Backoffice 7082 - Update docker-compose.yml, Dockerfiles, config.rs defaults, .env.example, backoffice routes, bench.sh, smoke.sh Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
1005 B
TypeScript
37 lines
1005 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
|
|
export async function POST(
|
|
request: NextRequest,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const { id } = await params;
|
|
const apiBaseUrl = process.env.API_BASE_URL || "http://api:7080";
|
|
const apiToken = process.env.API_BOOTSTRAP_TOKEN;
|
|
|
|
if (!apiToken) {
|
|
return NextResponse.json({ error: "API token not configured" }, { status: 500 });
|
|
}
|
|
|
|
try {
|
|
const response = await fetch(`${apiBaseUrl}/index/cancel/${id}`, {
|
|
method: "POST",
|
|
headers: {
|
|
Authorization: `Bearer ${apiToken}`,
|
|
},
|
|
});
|
|
|
|
if (!response.ok) {
|
|
return NextResponse.json(
|
|
{ error: `API error: ${response.status}` },
|
|
{ status: response.status }
|
|
);
|
|
}
|
|
|
|
const data = await response.json();
|
|
return NextResponse.json(data);
|
|
} catch (error) {
|
|
console.error("Proxy error:", error);
|
|
return NextResponse.json({ error: "Failed to cancel job" }, { status: 500 });
|
|
}
|
|
}
|