https://github.com/binary-husky/deploy-python-fastapi-in-vercel
https://github.com/binary-husky/deploy-python-fastapi-in-vercel
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/binary-husky/deploy-python-fastapi-in-vercel
- Owner: binary-husky
- Created: 2023-05-28T14:36:49.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-28T15:03:57.000Z (almost 3 years ago)
- Last Synced: 2025-01-23T06:14:44.436Z (about 1 year ago)
- Language: Python
- Homepage: https://deploy-python-fastapi-in-vercel-six.vercel.app
- Size: 9.21 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
:package: deploy-python-fastapi-in-vercel
This example shows how to use FastApi on Vercel with Serverless Functions using the Python Runtime.
Systems on which it has been tested.
Did you like the project? Please, considerate a donation to help improve!
✨
# Getting started
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhebertcisco%2Fdeploy-python-fastapi-in-vercel%2Ftree%2Fmain%2Fpython%2FFastApi&demo-title=FastApi%20%2B%20Vercel&demo-description=Use%20FastApi%202%20on%20Vercel%20with%20Serverless%20Functions%20using%20the%20Python%20Runtime.&demo-url=https%3A%2F%2FFastApi-python-template.vercel.app%2F&demo-image=https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png)
# FastApi + Vercel
This example shows how to use FastApi 0.88.0 on Vercel with Serverless Functions using the [Python Runtime](https://vercel.com/docs/concepts/functions/serverless-functions/runtimes/python).
[](https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/actions/workflows/python-app.yml)
[](https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/actions/workflows/docker-image.yml)
## Demo
[deploy-python-fastapi-in-vercel.vercel.app](https://deploy-python-fastapi-in-vercel.vercel.app)
## How it Works
This example uses the Web Server Gateway Interface (WSGI) with FastApi to enable handling requests on Vercel with Serverless Functions.
## Running Locally
### With Docker
```bash
# Build the Docker image
docker build -t deploy-python-fastapi-in-vercel .
# Run the Docker container
docker run -p 8000:8000 deploy-python-fastapi-in-vercel
```
### With uvicorn
#### Install dependencies
```bash
pip install -r requirements.txt
```
```bash
uvicorn main:app --host 0.0.0.0 --port 8000
```
Your FastApi application is now available at `http://localhost:8000`.
## One-Click Deploy
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples):
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhebertcisco%2Fdeploy-python-fastapi-in-vercel%2Ftree%2Fmain%2Fpython%2FFastApi&demo-title=FastApi%20%2B%20Vercel&demo-description=Use%20FastApi%202%20on%20Vercel%20with%20Serverless%20Functions%20using%20the%20Python%20Runtime.&demo-url=https%3A%2F%2FFastApi-python-template.vercel.app%2F&demo-image=https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png)
## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](issues).
## Show your support
Give a ⭐️ if this project helped you!
Or buy me a coffee 🙌🏾
## 📝 License
Copyright © 2023 [Hebert F Barros](https://github.com/hebertcisco).
This project is [MIT](LICENSE) licensed.