-
Notifications
You must be signed in to change notification settings - Fork 0
/
forkooor.js
45 lines (36 loc) · 1.55 KB
/
forkooor.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
const express = require("express");
const swaggerUi = require("swagger-ui-express");
const swaggerSpec = require("./swagger");
const cors = require("cors");
const generalRouter = require("./src/routers/utils/index");
const makerRouter = require("./src/routers/maker/index");
const sparkRouter = require("./src/routers/spark/index");
const liquityRouter = require("./src/routers/liquity/index");
const aaveV3Router = require("./src/routers/aavev3/index");
const curveusdRouter = require("./src/routers/curveusd/index");
const compoundV3Router = require("./src/routers/compoundV3/index");
const morphoBlueRouter = require("./src/routers/morpho-blue/index");
const app = express();
app.use(cors());
app.use(express.json({ extended: true }));
app.use("/utils", generalRouter);
app.use("/maker", makerRouter);
app.use("/spark", sparkRouter);
app.use("/liquity", liquityRouter);
app.use("/aave/v3", aaveV3Router);
app.use("/curveusd", curveusdRouter);
app.use("/compound/v3", compoundV3Router);
app.use("/morpho-blue", morphoBlueRouter);
app.use("/swagger.json", (req, res) => {
res.setHeader("Content-Type", "application/json");
res.send(swaggerSpec);
});
app.use("/", swaggerUi.serve, swaggerUi.setup(swaggerSpec));
const port = 3000;
app.listen(port, () => {
console.log(`App listening on port ${port}`);
});
// / TODO: folder and files for util functions
// / TODO: split helpers utils into view (getters), strategy sub specifics, and state changing
// / TODO: README file for adding new routers/functions/endpoints etc.
// / TODO: Throw error and 500 when tx fails