gmokercom/back-end/index.js

30 lines
529 B
JavaScript
Raw Normal View History

2024-09-10 16:08:10 +00:00
import { PrismaClient } from "@prisma/client";
const client = new PrismaClient();
client.$connect();
console.log("conected");
function createuser() {
client.user
.create({
data: {
email: "exemple@gmrgerail.com",
pswd: "1234",
username: "lazlor",
},
})
.then(() => {});
}
//createuser();
async function getuser(req, res) {
const posts = await client.user.findMany({
where: {
username: "lazlor",
},
});
console.log(posts);
}
getuser();
client.$disconnect();