i deployed svelte kit (which works) with API folder that has main.py using flask which is used for all API routes but whenever i use it i get 404 error (from vercel not sveltekit)
here is the top of main.py, folder structure and vercel.json
vercel.json:
i noticed in next.js and flask example that they did not use any vercel.json file and dealt with routing in the config of next js, could this be the source of my issue?
Accepted answer
i solved the issue by renaming main to index and adding "/api/" before every route in the flask python code and removing the static and template folder stuff in app params
Vercel Alum
Thanks for coming back and sharing your solution!
For anyone else looking, we've also created this community post on other steps you can take to debug 404 errors.
Hey, I'm having related issues and
And I'm an experienced data engineer but very new to anything that touches front end, especially making front end and backend talk to each other.
I've got my app working locally, with flask and svelte both spun up in different terminals, and I've got it deployed and running without 404, but I can't get my app to talk to each other, getting 500 errors, and it seems like my flask app isn't receiving anything.
This seems similar enough to my issue that it would be best to add a comment, but happy to make a seperate post.
How can I fix this, or at least can I confirm that flask is running in vercel?
I want to run svelte, flask, with a sqlite db. Also, let me know if this is even a sensible thing to do.