'Call fetch in sveltekit endpoint
if i call fetch("http://localhost:3000/api/verify")
POST in endpoint, i got FetchError: request to http://localhost:3000/api/verify failed, reason: connect ECONNREFUSED ::1:3000
.
Is there a way do likt that? I cant fetch in endpoint
Solution 1:[1]
Assuming your api is in your svelte app, I believe your connection address should be "/api/verify" leave the localhost stuff out.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | evilsushi |