0.1.13 AI功能大改

This commit is contained in:
liaibo
2026-01-10 23:08:56 +08:00
parent 63050f3927
commit be71849aa5
37 changed files with 6400 additions and 160 deletions
@@ -0,0 +1,25 @@
import { NextResponse } from "next/server";
export const dynamic = "force-dynamic";
export async function GET() {
const backendUrl = process.env.BACKEND_URL ?? process.env.NEXT_PUBLIC_BACKEND_URL;
if (!backendUrl) {
return NextResponse.json({ status: "disabled" }, { status: 200 });
}
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), 2500);
try {
const response = await fetch(`${backendUrl}/health`, {
method: "GET",
signal: controller.signal,
});
return NextResponse.json({ status: response.ok ? "ok" : "error" }, { status: 200 });
} catch {
return NextResponse.json({ status: "error" }, { status: 200 });
} finally {
clearTimeout(timer);
}
}