forked from cyclic-software/starter-rest-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
76 lines (51 loc) · 2.62 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
const express = require('express')
const cors = require('cors')
const bodyParser = require('body-parser')
const errorHandler = require('./_helpers/error-handler')
const environment = require('./environment')
const PORT = process.env.PORT || 6001
const swaggerUi = require('swagger-ui-express');
const swaggerDocument = require('./swagger.json');
const app = express()
app.use('/api-docs', swaggerUi.serve);
app.get('/api-docs', swaggerUi.setup(swaggerDocument));
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
app.use(cors({
origin: '*'
}));
app.get('/', (req, res) => {
console.log('Welcome to NODE API (Port: ' + PORT + ' , Environment: ' + environment.env + ')')
res.send('Welcome to NODE API (Port: ' + PORT + ' , Environment: ' + environment.env + ')')
})
// Generate VAPID keys
const publicVapidKey = "BEKPLQAEHd_3zRpN2m-BM0tXaePeRODsKc_UBh75ptZwUo4Wtg7AJCklz_caWCcB3S6iTAntMlH6CK_PdUxqem4";
const privateVapidKey = "V6m2WCVjEcciyazC0oNgBvivkLx1pZWREwoxgw8-6xY";
app.use('/member', require('./controllers/member.controller'))
app.use('/admin', require('./controllers/admin.controller'))
app.use('/login', require('./controllers/login.controller'))
app.use('/masterLogin', require('./controllers/masterLogin.controller'))
app.use('/role', require('./controllers/role.controller'))
app.use('/email', require('./controllers/emailRoutes'))
app.use('/upi', require('./controllers/upi.controller'))
app.use('/subscription', require('./controllers/subscriptions.controller'))
app.use('/wallet', require('./controllers/wallet.controller'))
app.use('/withdraw', require('./controllers/withdraw.controller'))
app.use('/payment', require('./controllers/payment.controller'))
app.use('/game', require('./controllers/game.controller'))
app.use('/game2', require('./controllers/game2.controller'))
app.use('/sms', require('./controllers/mobileSms.controller'))
app.use('/feedback', require('./controllers/feedback.controller'))
app.use('/packages', require('./controllers/packages.controller'))
app.use('/game1F', require('./controllers/game1F.controller'))
app.use('/game2F', require('./controllers/game2F.controller'))
app.use('/profit', require('./controllers/profit.controller'))
app.use('/orderId', require('./controllers/orderId.controller'))
app.use('/notification', require('./controllers/sendNotification.controller'))
app.use('/roomeCode', require('./service/roomCode'))
app.use('/upload', require('./fileUpload'))
app.use('/masterimport', require('./controllers/masterimport.controller'))
app.use(errorHandler)
app.listen(PORT, () => {
console.log(`Server started on port ${PORT} , Environment: ${environment.env}`)
})