useEffect(() => {
async function getData() {
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Bearer ' + API_KEY,
},
};
const response = await axios.get(
'http://localhost:3000/articles',
options
);
setArticles(response.data);
}
getData();
}, [request]);