-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
38 lines (29 loc) · 1.14 KB
/
server.js
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
31
32
33
34
35
36
37
38
const express = require('express')
const logger = require('morgan')
const cors = require('cors')
const http = require('http')
const dotenv = require('dotenv')
const cookieParser = require('cookie-parser')
const { swaggerUi, specs } = require('./swagger')
dotenv.config({path:'./.env'})
const app = express()
const port = process.env.PORT || 3000
const dbName = 'inha'
app.use(cors())
app.use(logger('dev'))
app.use(express.json())
app.use(express.urlencoded({extended:true}))
app.use(cookieParser())
/**************************************************************************/
app.use('/', require('./router/login'))
app.use('/', require('./router/mypage'))
app.use('/', require('./router/song'))
app.use('/', require('./router/packboard'))
app.use('/', require('./router/noteboard'))
app.use('/', require('./router/newboard'))
app.use('/', require('./router/fixboard'))
app.use('/', require('./router/coin'))
app.use('/', require('./router/admin'))
/**************************************************************************/
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(specs));
app.listen(port, () => console.log(`Listening on port ${port}`))