Answer the question
In order to leave comments, you need to log in
Why is my Not Found page popping up?
I keep getting the Not Found error.
const Koa = require('koa'),
Client = require('node-rest-client').Client;
const app = new Koa();
const client = new Client();
const url = 'https://www.binance.com/api/v1/klines?interval=1h&limit=24&symbol=BNBBTC';
app.use(async ctx => {
await client.get(url, (data, response) => {
ctx.body = JSON.stringify(data);
});
});
app.listen(3002);
[ [ 1534849200000,
'0.00151270',
'0.00151480',
'0.00150620',
'0.00150950',
'12238.78000000',
1534852799999,
'18.49577488',
1045,
'7293.00000000',
'11.02999493',
'0' ],
...
]
let dataParse = client.get(url, (data, response) => {
return data;
});
console.log(dataParse);
ClientRequest {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
href: 'https://www.binance.com/api/v1/klines?interval=1h&limit=24&symbol=BNBBTC',
options:
{ host: 'www.binance.com',
port: null,
path: '/api/v1/klines?interval=1h&limit=24&symbol=BNBBTC',
href: 'https://www.binance.com/api/v1/klines?interval=1h&limit=24&symbol=BNBBTC',
method: 'GET',
headers: {} },
_httpRequest:
Writable {
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree: [Object] },
writable: true,
domain: null,
.....
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question