Console Log Test
%%js
const apiUrl = “https://backendrocketmain.stu.nighthawkcodingsociety.com/api/recipe/recipes”;
fetch(apiUrl)
.then(response => {
if (!response.ok) {
throw new Error(Network response was not ok: ${response.status}
);
}
return response.json();
})
.then(data => {
console.log(“Data from the API:”, data);
})
.catch(error => {
console.error(“There was a problem fetching the data:”, error);
});