mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-18 16:07:10 +00:00
12 lines
356 B
TypeScript
12 lines
356 B
TypeScript
|
|
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 });
|
||
|
|
}
|
||
|
|
}
|