-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
52 lines (46 loc) · 1.62 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
47
48
49
50
51
52
const express = require("express");
const app = express();
app.use(express.static("nopsta.com", { extensions: ["html"] }));
app.use(`/oraand/:id`, (_, res) =>
res.sendFile(`nopsta.com/oraand/index.html`, { root: __dirname })
);
app.use(`/petarp/:id`, (_, res) =>
res.sendFile(`nopsta.com/petarp/index.html`, { root: __dirname })
);
app.get("/a/oraand/token-count", (_, res) => res.json({ value: 1024 }));
app.get("/a/oraand/mint-price", (_, res) => res.json({ value: 0.0256 }));
app.get("/a/petarp/token-count", (_, res) => res.json({ value: 64 }));
app.get("/a/petarp/mint-price", (_, res) => res.json({ value: 2560 }));
app.get("/a/petarp/versions", (_, res) =>
// 0xfff: TODO: Find out if this is derived from chainstate
res.json({
value: [
1, 0, 0, 1, 1, 2, 1, 1, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
],
})
);
/*
app.get("/a/petarp/:tokenId", async (req, res) => {
const response = await fetch('https://nopsta.com/a/petarp/' + req.params.tokenId);
const data = await response.json();
return res.json(data);
});
*/
app.get("/a/petarp/:tokenId/video", async (req, res) => {
return res.json({
"value": {
"v":0,
"status":"Generated",
"path":"\/petarp\/videos\/petarp-" + req.params.tokenId.padStart(3, "0") + ".mp4"
}
});
});
app.get("/a/petarp/custom-bytes", (_, res) =>
res.json(require("./mock").CUSTOM_BYTES_RESPONSE_STUB)
);
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});