Horumarinta Web Full Stack
Tallaabo 16 / 21120 daqiiqo

Isku-xirka Frontend ↔ API

Isku-xirka Full Stack

Sharaxaad

Ku xir React/Next.js clients APIs-kaaga fetch helpers typed, auth headers, iyo UI states adag.

Tusaale code

typescript
export async function getSkills(token?: string) {
  const res = await fetch("/api/skills", {
    headers: token ? { Authorization: `Bearer ${token}` } : undefined,
    cache: "no-store",
  });
  if (!res.ok) throw new Error("Failed to load skills");
  return res.json();
}

Agab waxtar leh

Layli

Ku xir Next.js UI Express/Next API oo leh loading, empty, iyo error states.