-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
30 lines (23 loc) · 914 Bytes
/
index.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
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
require('dotenv').load();
require('./config/date-config');
const application = express();
const userRoute = require('./routes/user');
const loginRoute = require('./routes/login');
const questRoute = require('./routes/quest');
const mobRoute = require('./routes/mob');
const questReportRoute = require('./routes/quest-report');
const credentialMiddleware = require('./middleware/credential');
application.use(credentialMiddleware);
application.use(cors());
application.use(bodyParser.json());
application.use('/user', userRoute);
application.use('/login', loginRoute);
application.use('/quest', questRoute);
application.use('/mob', mobRoute);
application.use('/quest-report', questReportRoute);
application.listen(process.env.PORT || 3000, () => {
console.log('listening ' + process.env.PORT)
})