Reviewed-on: #6 Co-authored-by: Clement <c.boesmier@aptatio.com> Co-committed-by: Clement <c.boesmier@aptatio.com>
16 lines
453 B
TypeScript
16 lines
453 B
TypeScript
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}`)
|
|
}) |