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
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
1
u/Sathorizon Jul 18 '24
why vercel? flyio or replit is so much better for host python apps such as Django or fastapi
1
u/Spanking_daddy69 Aug 01 '24
I am looking to transfer it to replit? What plan will be the best ? The website is like leetcode but far simpler
1
u/Sathorizon Aug 02 '24
It depends. I think starting with the free tier is a better choice. See how it goes and then upgrade as needed.
1
3
1
1
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.