DEV Community

Cover image for prueba de osttt
placido
placido

Posted on

prueba de osttt

es to es una prueba

import { notFound } from "next/navigation";

export async function fetchPosts() {
  console.log(process.env.NEXT_PUBLIC_DEVTO_USERNAME);
  const res = await fetch(
    `https://dev.to/api/articles?username=${process.env.NEXT_PUBLIC_DEVTO_USERNAME}`,
    {
      next: { revalidate: 3 * 60 * 60 },
    }
  );

  if (!res.ok) notFound();
  return res.json();
}

export async function fetchPost(slug) {
  const res = await fetch(
    `https://dev.to/api/articles/${process.env.NEXT_PUBLIC_DEVTO_USERNAME}/${slug}`,
    {
      next: { revalidate: 3 * 60 * 60 },
    }
  );

  if (!res.ok) notFound();
  return res.json();
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)