feat: init-express-backend (#6)
Reviewed-on: #6 Co-authored-by: Clement <c.boesmier@aptatio.com> Co-committed-by: Clement <c.boesmier@aptatio.com>
This commit is contained in:
16
Express/barAndCafe/src/server.ts
Normal file
16
Express/barAndCafe/src/server.ts
Normal file
@ -0,0 +1,16 @@
|
||||
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}`)
|
||||
})
|
Reference in New Issue
Block a user