не роботает Обмен валют axios try catch
хочу что бы в консоли chrome отображался обмен валют api но не понимаю как сделать код:
import axios from 'axios';
import express from 'express';
import bodyParser from 'body-parser';
const app = express()
const port = 3000;
app.use(bodyParser.urlencoded({ extended: true }));
app.get("/", (req,res) => {
res.render("index.ejs", {})
})
const options = {
method: 'GET',
url: 'https://currency-exchange.p.rapidapi.com/listquotes',
headers: {
'X-RapidAPI-Key': 'apikey',
'X-RapidAPI-Host': 'currency-exchange.p.rapidapi.com'
}
};
try {
const response = await axios.request(options);
console.log(response.data);
console.log(response)
} catch (error) {
console.error(error);
}
app.listen(port, () => {
console.log(`Server running on port: ${port}`);
});