This commit is contained in:
2026-06-10 02:16:08 -06:00
parent 4334052267
commit c3f4449296
10 changed files with 284 additions and 23 deletions
+16
View File
@@ -0,0 +1,16 @@
import { NextResponse } from "next/server";
import { prisma } from "@/lib/db";
export const dynamic = "force-dynamic";
export async function GET() {
try {
await prisma.$queryRaw`SELECT 1`;
return NextResponse.json({ status: "ok", database: "ok" });
} catch {
return NextResponse.json(
{ status: "error", database: "unreachable" },
{ status: 503 }
);
}
}
+6 -1
View File
@@ -1,7 +1,12 @@
import { NextRequest, NextResponse } from "next/server";
import { verifySession } from "@/lib/auth";
const PUBLIC_PATHS = ["/login", "/api/auth/login", "/api/auth/logout"];
const PUBLIC_PATHS = [
"/login",
"/api/auth/login",
"/api/auth/logout",
"/api/health",
];
export async function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;