i've a code like this:
var express = require('express');
var router = express.Router();
const Binance = require('node-binance-api');
const binance = new Binance().options({
APIKEY: 'APIKEY',
APISECRET: 'APISECRET',
useServerTime: true
});
r = [];
binance.balance((error, balances) => {
if ( error ) return console.error(error);
r = balances;
});
router.get('/', function(req, res, next) {
res.render("index", {page: 'home', user: req.thisUser, balances: r});
});
module.exports = router;
How can i get and pass the balances to get request in params? The result take long time to return.
Thank you all.