I would like to know how it is possible to centralize on a single api the data of several api
I would like to have the result of the four res.data at the address /coingeckotest
Currently I can see in the terminal the result I want to have but on the page /coingeckotest I have a return of "null" value
Thanks in advance for your answers
this is my script
async function datauniswap() {
let datauniswap = await axios
.get('https://api.coingecko.com/api/v3/exchanges/uniswap/tickers')
.then((res) => {
console.log(res.data)
})
return datauniswap
}
async function datasushiswap() {
let datasushiswap = await axios
.get('https://api.coingecko.com/api/v3/exchanges/sushiswap/tickers')
.then((res) => {
console.log(res.data)
})
return datasushiswap
}
async function datacurvefinance() {
let datacurvefinance = await axios
.get('https://api.coingecko.com/api/v3/exchanges/curve/tickers')
.then((res) => {
console.log(res.data)
})
return datacurvefinance
}
async function dataquickswap() {
let dataquickswap = await axios
.get('https://api.coingecko.com/api/v3/exchanges/quickswap/tickers')
.then((res) => {
console.log(res.data)
})
return dataquickswap
}
server.get('/coingeckotest', async (req, res) => {
exchangeone = await datauniswap();
exchangetwo = await datasushiswap();
exchangethree = await datacurvefinance();
exchangequattro = await dataquickswap();
cacheTime = Date.now();
res.json[exchangeone, exchangetwo, exchangethree, exchangequattro]
})