-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
27 lines (21 loc) · 777 Bytes
/
Copy pathserver.js
File metadata and controls
27 lines (21 loc) · 777 Bytes
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
const express = require('express');
const app = express();
const cors = require('cors')
const morgan = require('morgan')
require('dotenv').config();
require('./config/db.connection');
app.use(cors());
app.use(morgan("dev"));
const { MONGODB_URI } = process.env;
const PORT = process.env.PORT || 4000
const gamesController = require('./controllers/games-controller')
const playersController = require('./controllers/players-controller')
const userController = require('./controllers/auth-controllers')
app.use(express.json())
app.use('/games', gamesController)
app.use('/players', playersController)
app.use('/auth', userController)
app.get('/', (req, res) => {
res.send('CheckUp API')
});
app.listen(PORT, () => console.log(`listening on PORT ${PORT}`));