-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (22 loc) · 743 Bytes
/
Copy pathindex.js
File metadata and controls
30 lines (22 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Libraries
const express = require('express')
const cors = require('cors')
const bodyParser = require('body-parser')
const swaggerUi = require('swagger-ui-express')
const swaggerDocument = require('./swagger.json')
const { spawnSync } = require('child_process')
// Application settings: express
const app = express()
const port = 3000
// Application settings: cors
app.use(cors())
// Application settings: body-parser
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
// Application settings: swagger-ui-express
app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument))
// Routes list
const routes = require('./router/Router.js')
app.use('/', routes)
// Application entry point
app.listen(port)