forked from ABXTrading/epicurus-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.js
More file actions
22 lines (22 loc) · 841 Bytes
/
client.js
File metadata and controls
22 lines (22 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const http = require("http");
const index_1 = require("../index");
const epicurus = index_1.default();
const server = http.createServer((req, res) => {
epicurus.request('findAccountBalanceHistory', { hello: 'world' }).then((r) => {
res.setHeader('Content-Type', 'text/html');
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('ok');
}).catch((e) => {
console.log(e.message);
res.writeHead(500, { 'Content-Type': 'text/plain' });
res.end();
});
});
server.on('clientError', (err, socket) => {
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
});
server.listen(22222);
console.log('Epicurus Client booted on 22222. Will request findAccountBalanceHistory');
//# sourceMappingURL=client.js.map