How to publish a forward facing api in sveltekit
I know that perhaps a dedicated server would be better for this, however I’m not familiar with server only frameworks. But I’m very familiar with SvelteKit api routes. I decided to create a route named “/API” Where I have a handler class that will determine which method to run in the server based on the string passed as the func parameter in the post request. This does return the data properly when I’m using the svelte client. However, after publishing the file to Vercel It was not able to fetch the data. I will include the error message at the end since it’s very long.
Here is the “/API/+server.ts” file