-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
76 lines (69 loc) · 2.51 KB
/
app.ts
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import express from "express";
import { json } from "body-parser";
import cors from "cors";
import * as dotenv from "dotenv";
import bodyparser from "body-parser";
import multer from "multer";
import cookieParser from "cookie-parser";
import { getAllPlayersRouter } from "./src/routes/getAllPlayers";
import { getOnePlayerRouter } from "./src/routes/getOnePlayer";
import { signinRouter } from "./src/routes/Adminroutes/signin";
import { signupRouter } from "./src/routes/Adminroutes/signup";
import { signoutRouter } from "./src/routes/Adminroutes/signout";
import { updateFundingAddressRouter } from "./src/routes/updateUser";
import { setPlayerAddressRouter } from "./src/routes/setPlayerAddress";
import { setWalletAddressRouter } from "./src/routes/setWalletAddress";
import { updateScoreRouter } from "./src/routes/Gameroutes/updateScore";
import { scheduleNFTDistribution } from "./src/services/NFTService";
import { currentuserRouter } from "./src/routes/currentuser";
import { checkwalletRouter } from "./src/routes/checkWalletAddress";
import { gameSetAddressRouter } from "./src/routes/Gameroutes/gameupdateaddress";
import { gamecheckwalletRouter } from "./src/routes/Gameroutes/gamewalletcheck";
import { gamesigninRouter } from "./src/routes/Adminroutes/game-signin";
import { decrementMintCountRouter } from "./src/routes/decrementMintCount";
import { cronJobRouter } from "./src/routes/cron";
const app = express();
app.use(json());
dotenv.config();
app.use(cookieParser());
app.use(
cors({
origin: true,
credentials: true,
})
);
app.use(
bodyparser.urlencoded({
extended: true,
})
);
app.use(updateFundingAddressRouter);
app.use(getAllPlayersRouter);
app.use(getOnePlayerRouter);
app.use(signinRouter);
app.use(signupRouter);
app.use(signoutRouter);
app.use(updateScoreRouter);
app.use(setPlayerAddressRouter);
app.use(setWalletAddressRouter);
app.use(currentuserRouter);
app.use(checkwalletRouter);
app.use(gameSetAddressRouter);
app.use(gamecheckwalletRouter);
app.use(gamesigninRouter);
app.use(decrementMintCountRouter);
app.use(cronJobRouter);
app.all("*", async (req, res) => {
try {
res.status(404).send({ message: "Route not found" });
} catch (e) {
console.log(e);
console.log({ error: e.message });
}
});
scheduleNFTDistribution.start();
console.log(
// "NFT Distribution service running...Scheduled to run everyday at 12 am"
"NFT Distribution service running...Scheduled to run every 15 minutes"
);
export { app };