Next.js Discord

Discord Forum

Data Caching and API

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
When implementing the api route
http://localhost:8000/api/articles/halaal_vs_haraam
the route shows like the first image, but that is wrong! So my problem is how do I show 1 API at the time

export const getArtikelen = async () => {
  const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/articles`, {
    cache: "no-store",
  });
  const artikelenData = await res.json();
  return artikelenData.data;
}

0 Replies