16 lines
375 B
JavaScript
16 lines
375 B
JavaScript
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("/", async (_req, res) => {
|
|
const result = await prisma.test.findMany();
|
|
res.send(result);
|
|
});
|
|
|
|
app.listen(port, () => {
|
|
console.log(`Server listening on http://localhost:${port}`);
|
|
});
|