Ajout des variables d'environemment

This commit is contained in:
ElPoyo
2025-09-29 11:56:48 +02:00
parent b4a468c14b
commit 45f76cc5c8
8 changed files with 42 additions and 11 deletions

View File

@@ -3,12 +3,18 @@ import cors from 'cors'
import fs from 'fs/promises'
import path from 'path'
import { fileURLToPath } from 'url'
import dotenv from 'dotenv'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
/** Configuration dotenv
* Permet de charger les variables d'environnement depuis un fichier .env
* */
dotenv.config()
const app = express()
const PORT = process.env.PORT || 3001
const PORT = process.env.PORT
// Middleware
app.use(cors())