This commit is contained in:
Janis
2023-01-29 17:33:37 +01:00
parent 92ec33fea4
commit 0491b673aa
18 changed files with 600 additions and 156 deletions

11
pages/api/images/index.ts Normal file
View File

@@ -0,0 +1,11 @@
import { Request, Response } from "express";
import prisma from "../../../lib/prisma";
import { Prisma } from "@prisma/client";
export default async function handler(req: Request, res: Response) {
res.setHeader("Content-Type", "application/json");
if (req.method == "GET") {
res.send(await prisma.image.findMany())
}
}