-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (38 loc) · 1.46 KB
/
index.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
42
43
44
45
46
import express from "express";
import cors from "cors";
import { portfolioRouter } from "./routes/portfolio.js";
import { userRouter } from "./routes/user.js";
import { watchlistRouter } from "./routes/watchlist.js";
import { depositRouter } from "./routes/deposit.js";
import { withdrawRouter } from "./routes/withdraw.js";
import { soldTickerRouter } from "./routes/soldticker.js";
import config from "./config.js";
import connectToMongoDB from "./db.js";
import { emailRouter } from "./routes/email.js";
import { verifyRouter } from "./routes/verify.js";
import { kycRouter } from "./routes/kyc.js";
import { walletRouter } from "./routes/wallet.js";
import { notificationRouter } from "./routes/notification.js";
const app = express();
const port = config.port;
connectToMongoDB();
app.use(cors());
app.use(express.json());
app.get("/", (req, res) => {
return res.send("Welcome to the Investment Advisor API");
});
app.use(express.static("public"));
app.use("/api/user", userRouter);
app.use("/api/kyc", kycRouter);
app.use("/api/portfolio", portfolioRouter);
app.use("/api/watchlist", watchlistRouter);
app.use("/api/deposit", depositRouter);
app.use("/api/withdraw", withdrawRouter);
app.use("/api/wallet", walletRouter);
app.use("/api/soldticker", soldTickerRouter);
app.use("/api/email", emailRouter);
app.use("/api/verify", verifyRouter);
app.use("/api/notification", notificationRouter);
app.listen(port, () => {
console.log(`App started at http://localhost:${port}`);
});