elysiajs / eden

Fully type-safe Elysia client
MIT License
154 stars 37 forks source link

Remove URL transforming inside eden treaty 2 #63

Closed hazelnutcloud closed 5 months ago

hazelnutcloud commented 6 months ago

I often use elysia alongside eden embedded inside sveltekit. Sveltekit provides a custom fetch function inside load functions that , when used with plain relative paths e.g: fetch('/api') will call the server-side function directly when performing server-side rendering. More info here

Eden treaty 2 transforms the URL passed into treaty() by appending https:// to it. This disables sveltekit's features when using its fetch. To fix this, remove any transformation functions inside eden treaty 2 or expose configuration options to do so.