| Total Complexity | 0 |
| Complexity/F | 0 |
| Lines of Code | 24 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 6 | ||
| Bugs | 0 | Features | 0 |
| 1 | /** |
||
| 7 | const express = require('express'); |
||
| 8 | const bodyParser = require('body-parser'); |
||
| 9 | const socketIo = require('socket.io'); |
||
| 10 | |||
| 11 | const cors = require('./middlewares/cors'); |
||
| 12 | const xPoweredBy = require('./middlewares/xPoweredBy'); |
||
| 13 | const routes = require('./routes/index'); |
||
| 14 | |||
| 15 | require('./configs/main'); |
||
| 16 | |||
| 17 | // Init app. |
||
| 18 | const app = express(); |
||
| 19 | const server = app.listen(global.APP_PORT); |
||
| 20 | global.socket = socketIo.listen(server); |
||
| 21 | |||
| 22 | // Configure app. |
||
| 23 | app.use(express.static('./src/public')); |
||
| 24 | app.set('views', './src/views'); |
||
| 25 | app.set('view engine', 'pug'); |
||
| 26 | app.use(bodyParser.json()); |
||
| 27 | app.use(bodyParser.urlencoded({ extended: true })); |
||
| 28 | app.use(cors); |
||
| 29 | app.use(xPoweredBy); |
||
| 30 | app.use('/', routes); |
||
| 31 |