#node.js #express #async-await
Вопрос:
Я не могу найти рабочее решение. Я получаю «Суперагент: запрос был отправлен дважды, потому что были вызваны оба .end() и .then ()». Сообщение об ошибке.
const getPrice = async () =gt; { //Get the curent market price // var marketSymobl = checkOrders[i].symbol.split(" - ")[0].toUpperCase() // console.log(checkOrders[i].symbol) var price = await finnhubClient.quote("APPLE", (error, data, response) =gt; { const currPrice = data.c console.log(currPrice); return currPrice }); } const x = getPrice().then(price =gt; (console.log(x)))