测试
This commit is contained in:
@@ -22,13 +22,6 @@ export async function POST(req: Request) {
|
||||
}
|
||||
|
||||
const initToken = process.env.INIT_SETUP_TOKEN;
|
||||
const isProduction = process.env.NODE_ENV === "production";
|
||||
if (isProduction && !initToken) {
|
||||
return NextResponse.json(
|
||||
{ error: "Server misconfigured: INIT_SETUP_TOKEN is required in production." },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
|
||||
if (initToken) {
|
||||
const providedToken = req.headers.get("x-init-token");
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const settings = await prisma.globalSettings.findUnique({
|
||||
where: { id: "default" },
|
||||
select: { id: true },
|
||||
});
|
||||
return NextResponse.json({ initialized: Boolean(settings) });
|
||||
} catch {
|
||||
return NextResponse.json({ initialized: false, error: "Failed to check settings status" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user