Ajout des variables d'environemment
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user