I used Node, Express and MongoDB to create simple API that should allow me get JSON data, next I deployed it on Heroku.
Whenever I tried to fetch it (locally or using Heroku link), I received this error: Uncaught (in promise) TypeError: Failed to fetch This is my code:
async function fetchFlats () {
const res = await fetch("https://rocky-basin-55272.herokuapp.com/");
const data = await res.json();
console.log(data);
}
fetchFlats()