updated health check db (#195)
Some checks are pending
Runs E2E API Tests / build (20.x) (push) Waiting to run
Runs E2E API Tests / build (22.x) (push) Waiting to run
Lint & build / lint_and_build (20.x) (push) Waiting to run
Lint & build / lint_and_build (22.x) (push) Waiting to run
TOC Generator / TOC Generator (push) Waiting to run

* updated health check db

* improved code style
This commit is contained in:
Zai Shi 2024-08-17 16:43:57 -07:00 committed by GitHub
parent 32d352b32b
commit b2f92625da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,16 @@
import { prismaClient } from "@/prisma-client";
import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors";
import { NextRequest } from "next/server";
export async function GET(req: NextRequest) {
if (req.nextUrl.searchParams.get("db")) {
const project = await prismaClient.project.findFirst({});
if (!project) {
throw new StackAssertionError("No project found");
}
}
return Response.json({
status: "ok",
}, {
@ -9,6 +19,6 @@ export async function GET(req: NextRequest) {
"Access-Control-Allow-Methods": "*",
"Access-Control-Allow-Headers": "*",
"Access-Control-Expose-Headers": "*",
},
}
});
}