-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
41 lines (28 loc) · 1.08 KB
/
app.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
32
33
34
35
36
37
38
39
40
41
const express = require("express")
const bodyParser = require("body-parser")
const dotenv = require("dotenv")
dotenv.config()
const betsRoutes = require("./routes/bets")
const gamesRoutes = require("./routes/games")
const playersRoutes = require("./routes/players")
const teamsRoutes = require("./routes/teams")
const usersRoutes = require("./routes/users")
const depositsRoutes = require("./routes/deposits")
const reviewsRoutes = require("./routes/reviews")
const { authenticationMiddleware } = require("./middlewares/auth")
const app = express()
app.use(bodyParser.json())
app.use("/bets", authenticationMiddleware)
app.use("/bets", betsRoutes)
app.use("/games", authenticationMiddleware)
app.use("/games", gamesRoutes)
app.use("/players", authenticationMiddleware)
app.use("/players", playersRoutes)
app.use("/teams", authenticationMiddleware)
app.use("/teams", teamsRoutes)
app.use("/users", usersRoutes)
app.use("/deposits", authenticationMiddleware)
app.use("/deposits", depositsRoutes)
app.use("/reviews", authenticationMiddleware)
app.use("/reviews", reviewsRoutes)
app.listen(9876)