import type { PublicCategorySummary, PublicSite } from "@imen/shared"; /** Server-side call to the backend API (internal network address) */ export const serverApi = (path: string) => $fetch(path, { baseURL: useRuntimeConfig().apiInternalUrl, retry: 1 }); export const fetchCategories = () => serverApi("/public/categories"); export const fetchSite = () => serverApi("/public/site"); /** Absolute URL on the production domain */ export const absUrl = (p: string) => new URL(p, useRuntimeConfig().public.siteUrl).toString();