forked from Hands-Up-Card-Open/HandsUpForServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
30 lines (26 loc) · 947 Bytes
/
main.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
require('dotenv').config();
var express = require('express');
var app = express();
var authRouter = require('./routes/auth');
var categoryRouter = require('./routes/category');
var cardRouter = require('./routes/card');
var gameRouter = require('./routes/game');
var bodyParser = require('body-parser');
app.use(express.json());
app.use(bodyParser.json({limit: '50mb', extended: true}));
app.use(bodyParser.urlencoded({limit: "50mb", extended: true, parameterLimit:50000}));
app.use(bodyParser.text({ limit: '200mb' }));
app.use('/auth', authRouter);
app.use('/category', categoryRouter);
app.use('/category/card', cardRouter);
app.use('/game', gameRouter);
app.use(function(req, res, next) {
res.status(404).send('Sorry cant find that!');
});
app.use(function(err, req, res, next) {
console.error(err.stack)
res.status(500).send('Something broken!')
});
app.listen(process.env.PORT, function() {
console.log('success!!');
});