mirror of
https://github.com/Floriansylvain/PopCorn.git
synced 2026-08-19 11:43:23 +02:00
Essaie de coudinary : échec
This commit is contained in:
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"liveServer.settings.port": 5501
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Generated
+1551
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user