Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 24 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 6 | ||
Bugs | 0 | Features | 0 |
1 | const express = require('express'); |
||
2 | const bodyParser = require('body-parser'); |
||
3 | const socketIo = require('socket.io'); |
||
4 | |||
5 | const routes = require('./routes/index'); |
||
6 | const cors = require('./middlewares/cors'); |
||
7 | |||
8 | require('./configs/main'); |
||
9 | |||
10 | const app = express(); |
||
11 | const server = app.listen(global.APP_PORT); |
||
12 | global.socket = socketIo.listen(server); |
||
13 | |||
14 | app.use(express.static('./src/public')); |
||
15 | app.set('views', './src/views'); |
||
16 | app.set('view engine', 'pug'); |
||
17 | app.use(bodyParser.json()); |
||
18 | app.use(bodyParser.urlencoded({ extended: true })); |
||
19 | app.use(cors); |
||
20 | app.use((req, res, next) => { |
||
21 | res.removeHeader('X-Powered-By'); |
||
22 | next(); |
||
23 | }); |
||
24 | app.use('/', routes); |
||
25 |