Essaie de coudinary : échec

This commit is contained in:
ETHEVE Fabien
2023-02-09 13:28:11 +01:00
parent 7108d33322
commit f9c3a9ec9b
7 changed files with 1574 additions and 4 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
+6 -2
View File
@@ -1,7 +1,7 @@
import express from "express";
import { PrismaClient } from "@prisma/client";
import createError from "http-errors"
import cors from 'cors';
import jeux from './route/jeux.js'
import groupe from './route/groupe.js'
const app = express()
@@ -11,7 +11,11 @@ app.use(express.urlencoded({extended:true}))
const port = 3500
app.use(
cors({
origin: ["http://127.0.0.1:5500"],
})
);
app.use('/',jeux)
app.use('/',groupe)
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

+1551
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -1,9 +1,12 @@
{
"dependencies": {
"@prisma/client": "^4.9.0",
"cloudinary": "^1.33.0",
"cors": "^2.8.5",
"express": "^4.18.2",
"http-errors": "^2.0.0",
"https-error": "^1.0.2",
"multer": "^1.4.5-lts.1",
"nodemon": "^2.0.20",
"prisma": "^4.9.0",
"zod": "^3.20.2"
+9
View File
@@ -8,6 +8,7 @@ const prisma = new PrismaClient();
router.post('/jeux',async (req,res,next)=>{
let jeuxData;
jeuxData = jeuxValidation.parse(req.body)
@@ -31,6 +32,14 @@ router.post('/jeux',async (req,res,next)=>{
})
router.get('/jeux', async(req,res)=>{
let jeux = await prisma.jeux.findMany({
include:{
groupe:true
}
})
res.json(jeux)
})