mirror of
https://github.com/Floriansylvain/PopCorn.git
synced 2026-08-19 11:43:23 +02:00
Refactor general pour ajout d'un flow CI/CD
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
import express from "express";
|
||||
import cors from 'cors';
|
||||
import jeux from './route/jeux.js'
|
||||
import groupe from './route/groupe.js'
|
||||
import * as dotenv from 'dotenv'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
const app = express()
|
||||
|
||||
app.use(express.json())
|
||||
app.use(express.urlencoded({ extended: true }))
|
||||
|
||||
const port = process.env.API_PORT
|
||||
|
||||
app.use(
|
||||
cors({
|
||||
origin: [process.env.CORS_ORIGIN ?? '*'],
|
||||
})
|
||||
);
|
||||
app.use('/', jeux)
|
||||
app.use('/', groupe)
|
||||
|
||||
// run the server
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening on port ${port}`);
|
||||
});
|
||||
Reference in New Issue
Block a user