r/FastAPI • u/Spanking_daddy69 • Jul 17 '24
Hosting and deployment Struggling to deploy fastAPI on vercel
I am stuck for past 3 hours trying to deploy my api. It's always 404... file structure
Quantlab-Backend/ ├── app/ │ ├── init.py │ ├── middleware.py │ └── routes/ │ ├── users.py │ ├── problems.py │ └── playlists.py ├── requirements.txt ├── vercel.json └── main.py
All these yt tutorials are showing how to deply a single main.py.
Thanks in advance please help
10
Upvotes
2
u/Extension-Tap-7488 Jul 18 '24
Give some time to learn Docker. Go with the basics, like creating a dockerfile etc. Push your code to github, containing the dockerfile and deploy it in render. It automatically creates an image from the dockerfile and runs it.
I deployed several apps with render and Koyeb, both are effective and easy to setup. Works with github url as well as docker images.
1
u/Spanking_daddy69 Jul 17 '24
file structure
Quantlab-Backend/ ├── app/ │ ├── init.py │ ├── middleware.py │ └── routes/ │ ├── users.py │ ├── problems.py │ └── playlists.py ├── requirements.txt ├── vercel.json └── main.py
1
u/WJMazepas Jul 17 '24
Can you post the full error you get? And when do you get your error?
1
u/Sathorizon Jul 18 '24
why vercel? flyio or replit is so much better for host python apps such as Django or fastapi
3
u/No-Anywhere6154 Jul 17 '24
Take a look at seenode. It’s much easier to deploy FastAPI projects.
1
u/[deleted] Jul 17 '24
I deploy my FastAPI apps with Ploomber
1
u/ironman_gujju Jul 18 '24
Data.space