-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
68 lines (57 loc) · 1.47 KB
/
Copy pathindex.ts
File metadata and controls
68 lines (57 loc) · 1.47 KB
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
import express from "express";
const port = 3001;
const app = express();
app.set("view engine", "ejs");
app.use(express.static(__dirname + "/public"));
import { make_wallet } from "./master/wallet";
import { maker } from "./master/mint";
import bodyParser from "body-parser";
import { transfer } from "./master/transfer";
app.use(bodyParser.urlencoded({ extended: false }));
var y: { [key: string]: string } = {};
app.get("/wallet", (req, res) => {
(async function () {
y = await make_wallet();
console.log(y);
res.render("wall", y);
})();
});
app.get("/", (req, res) => {
res.render("index");
});
app.get("/make-your-own-token", (req, res) => {
res.render("tokenmaker");
});
var z = "";
app.post("/make-your-own-token", (req, res) => {
(async function t() {
var p = await maker(
req.body.tokenname,
req.body.symbol1,
req.body.description1,
req.body.image1,
y.secret
);
console.log(p);
res.render("final", p);
// setTimeout(() => {
// try {
// transfer(z, y.secret);
// res.render("transfer", { status: "success" });
// } catch {
// res.render("transfer", { status: "fail" });
// }
// }, 60000);
// res.render("middletime");
})();
});
// app.post("/transfer-money");
// {
// (async function t() {
// transfer(z, y.secret);
// })();
// }
app.listen(port, () => {
console.log(`now listening to ${port} `);
});
// all commented out is for the next version of the app