import * as dotenv from "dotenv";
import app from "./app";
import options from "./swaggerDef";
const swaggerJsdoc = require("swagger-jsdoc"),
    swaggerUi = require("swagger-ui-express");

dotenv.config({path: '../../.env'})

const port = parseInt(process.env.BAR_PORT || '3000')

const specs = swaggerJsdoc(options)
app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(specs))

app.listen(port, () =>{
    console.log(`serveur running in ${port}`)
})