mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-21 17:36:38 +00:00
Get Sites API Route
This commit is contained in:
parent
53c18d1fea
commit
400db0babf
11
app/api/sites/get_all/route.ts
Normal file
11
app/api/sites/get_all/route.ts
Normal 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 });
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user