26 lines
442 B
TypeScript
26 lines
442 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
import { getMaintenanceMode } from "@/lib/app-config";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET() {
|
|
try {
|
|
const enabled = await getMaintenanceMode();
|
|
|
|
return NextResponse.json(
|
|
{
|
|
enabled,
|
|
},
|
|
{ status: 200 },
|
|
);
|
|
} catch {
|
|
return NextResponse.json(
|
|
{
|
|
enabled: false,
|
|
},
|
|
{ status: 200 },
|
|
);
|
|
}
|
|
}
|