sveltekit api fetch from frontend not work

i doing follow this video: But work with deploy on vps, not with cf pages. in component import to +page.svelte i fetch like this: const checklink = async (id: number) => { try { const testLink = await fetch(/api/checkLink/${id}) return await testLink.json() } catch (error) { throw error } } In folder api/checkLink/[id]/+server.ts export const GET = async ({ params }) => { const checkLink = async (id: string) => { try { const testLink = await fetch(https://doaminlink.../${id}`) if (testLink.ok) { return https://domainlink/${id} } return https://linkb/${id} } catch (error) { throw error } } return new Response(JSON.stringify(await checkLink(; }`
SvelteKit API Routes & Endpoints
If you find my content useful and want to support the channel, consider contributing a coffee ☕: SvelteKit is a framework for building modern, high-performance, browser-based applications. It was developed by the team behind the popular Svelte framework and is powered by Svelte. Unlike other JavaScript frameworks, it does...
1 Reply
tymon5mo ago
no one had the same issue? No one help??