Add Prisma example

This commit is contained in:
2022-05-01 17:00:38 +02:00
parent 8da44976e1
commit a7d197752f
5 changed files with 61 additions and 2 deletions

View File

@ -1,9 +1,13 @@
import express from "express";
import Prisma from "@prisma/client";
const app = express();
const prisma = new Prisma.PrismaClient();
const port = process.send.PORT || 3000;
app.get("/", (req, res) => {
res.send("Hello World!");
app.get("/", async (_req, res) => {
const result = await prisma.test.findMany();
res.send(result);
});
app.listen(port, () => {