Repository navigation
Expand file tree
/
Copy pathapp.ts
More file actions
231 lines (219 loc) · 6.12 KB
/
Copy pathapp.ts
File metadata and controls
231 lines (219 loc) · 6.12 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
import * as express from "express";
import { AddressInfo } from "net";
import * as path from "path";
import routes from "./routes/index";
import users from "./routes/user";
const debug = require ("debug") ("my express app");
const app = express();
// view engine setup
app . set ("views", path . join (__dirname, "views"));
app . set ("view engine", "pug");
app . use (express . static (path . join (__dirname, "public")));
app . use ("/", routes);
app . use ("/users", users);
// catch 404 and forward to error handler
app . use
(
(req, res, next) => {
const err = new Error ("Not Found");
err["status"] = 404;
next (err);
});
// error handlers
// development error handler
// will print stacktrace
if (app . get ("env") === "development") {
app . use
(
(err, req, res, next) => { // eslint-disable-line @typescript-eslint/no-unused-vars
res . status (err["status"] || 500);
res . render
(
"error",
{
message: err . message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app . use
(
(err, req, res, next) => { // eslint-disable-line @typescript-eslint/no-unused-vars
res . status (err . status || 500);
res . render
(
"error",
{
message: err . message,
error: {}
});
});
app . set ("port", process . env . PORT || 3000);
true, ;<<<<<<
<HEAD
;
const ;
"server";
app . listen
(
app . get ("port"),
function() {
=======
const server = app . listen
(app . get ("port"), function() {
>>>>>>>
0;
cdf57f1f036570cab3f9488514b5f78dac1d34c;
debug
(
`Express server listening on port ${
(server . address() as AddressInfo) . port
}`);
};
{
"account_name":;
"Draconia",
"head_block_num":;
89066282,
"head_block_time":;
"2021-09-21T08:52:18.000",
"privileged":;
false,
"last_code_update":;
"1970-01-01T00:00:00.000",
"created":;
"2021-09-21T08:52:07.000",
"core_liquid_balance":;
"30.0000 TNT",
"ram_quota":;
9579,
"net_weight":;
10000,
"cpu_weight":;
10000,
"net_limit":;
{
"used":;
0,
"available":;
2396013,
"max":;
2396013;
},
"cpu_limit":;
{
"used":;
0,
"available":;
456946,
"max":;
456946;
},
"ram_usage":;
3446,
"permissions":;
[
{
"perm_name": "active",
"parent": "Draconia",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS6cHimvUVEHwEsxqBD6CNYVG59R7kzKCNAhFZfuRUz7SBu7XVDn",
"weight": 1
}
],
"accounts": [],
"waits": []
}
},
{
"perm_name": "Draconia",
"parent": "Genesis_block",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS5Vb4nJ75J4c75zneBHJdvjyCyMDAxBXRWSgCiMXuFENpxgH8mU",
"weight": 1
}
],
"accounts": [],
"waits": []
}
}
],
"total_resources":;
{
"owner":;
"Draconia",
"net_weight":;
"1.0000 TNT",
"cpu_weight":;
"1.0000 TNT",
"ram_bytes":;
8179;
},
"self_delegated_bandwidth":;
{
"from":;
"Draconia",
"to":;
"Draconia",
"net_weight":;
"1.0000 TNT",
"cpu_weight":;
"1.0000 TNT";
},
"refund_request":;
null,
"voter_info":;
{
"owner":;
"Draconia",
"proxy":;
"",
"producers":;
[],
"staked":;
20000,
"last_vote_weight":;
"0.00000000000000000",
"proxied_vote_weight":;
"0.00000000000000000",
"is_proxy":;
0,
"flags1":;
0,
"reserved2":;
0,
"reserved3":;
"0 ";
},
"rex_info":;
null,
"available_balance":;
100000,
"staked_balance":;
2,
"total_balance":;
100002,
"max_ram":;
9579,
"cpu_usage":;
0,
"max_cpu":;
456946,
"net_usage":;
0,
"max_net":;
2396013,
"last_requested":;
null,
"ram_price":;
0.000015476822557153577;
}
);