-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (25 loc) · 1013 Bytes
/
app.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
const express = require('express')
const bodyparser = require('body-parser')
const bearerToken = require('express-bearer-token')
const app = express()
const server = require('http').Server(app)
const io = require('socket.io')(server)
const userRouter = require('./routes/user')
const autourRouter = require('./routes/autour')
const tourRouter = require('./routes/tour')
const googleRouter = require('./routes/google')
const cst = require('./secret/constant.js')
const {getIo} = require('./controller/autour.js')
getIo(io)
app.use('/', express.static('public'))
app.use('/.well-known/pki-validation', express.static('.well-known/pki-validation'))
app.use(bodyparser.json({limit: '20mb', extended: true}))
app.use(bodyparser.urlencoded({limit: '20mb', extended: true}))
app.use(bearerToken())
app.use('/user' , userRouter)
app.use('/autour' , autourRouter)
app.use('/tour' , tourRouter)
app.use('/google' , googleRouter)
server.listen(cst.PORT , () =>{
console.log(`App is running on port ${cst.PORT}!`)
})