-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.js
31 lines (24 loc) · 858 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
31
require('dotenv').config();
const bodyParser = require('body-parser');
const cors = require('cors');
const express = require('express');
const http = require('http');
const Sentry = require('@sentry/node');
const sentryInit = require('./src/config/sentryConfig');
const setRoutes = require('./src/routes/BaseRoutes');
// const dailySchedule = require('./src/utils/schedule');
const { setupWebsocket } = require('./websocket');
const app = express();
sentryInit();
const server = http.Server(app);
app.use(express.json({ limit: '50mb' }));
app.use(express.urlencoded({ limit: '50mb' }));
setupWebsocket(server);
const databaseConnect = require('./src/config/database');
app.use(cors());
app.use(bodyParser.json());
databaseConnect();
// dailySchedule();
setRoutes(app);
app.use(Sentry.Handlers.errorHandler());
server.listen(process.env.PORT || 8000);