Get Sites API Route

This commit is contained in:
headlesdev 2025-05-18 12:12:49 +02:00
parent 53c18d1fea
commit 400db0babf

View File

@ -0,0 +1,11 @@
import { NextResponse } from "next/server";
import prisma from "@/app/prisma";
export async function GET() {
try {
const sites = await prisma.site.findMany();
return NextResponse.json({ sites }, { status: 200 });
} catch (error: any) {
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
}
}