react-server675fbba4
react-serverfilesexamplesreact-queryappget-comments.mjs
examples/react-query/app/get-comments.mjsmjs259 B126ec655
export async function getComments() {
  if (typeof document === "undefined") {
    const { default: comments } = await import("../data/comments.json");
    return comments;
  } else {
    const res = await fetch("/api/comments");
    return res.json();
  }
}