|
| 1 | +<p align="center"> |
| 2 | + <img width="100px" src="https://raw.githubusercontent.com/hebertcisco/vercel-typescript-express-api/cebd0c563141a4cc7d279997b8cb5dd9232d7591/.github/images/favicon512x512-vercel-typescript-express-api.png" align="center" alt=":package: deploy-python-fastapi-in-vercel" /> |
| 3 | + <h2 align="center">:package: deploy-python-fastapi-in-vercel</h2> |
| 4 | + <p align="center">This example shows how to use FastApi on Vercel with Serverless Functions using the Python Runtime.</p> |
| 5 | +</p> |
| 6 | + |
| 7 | + <p align="center"> |
| 8 | + <a href="https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/issues"> |
| 9 | + <img alt="Issues" src="https://img.shields.io/github/issues/hebertcisco/deploy-python-fastapi-in-vercel?style=flat&color=336791" /> |
| 10 | + </a> |
| 11 | + <a href="https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/pulls"> |
| 12 | + <img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/hebertcisco/deploy-python-fastapi-in-vercel?style=flat&color=336791" /> |
| 13 | + </a> |
| 14 | + <br /> |
| 15 | + <a href="https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/issues/new/choose">Report Bug</a> |
| 16 | + <a href="https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/issues/new/choose">Request Feature</a> |
| 17 | + </p> |
| 18 | + <h3 align="center">Systems on which it has been tested.</h3> |
| 19 | + <p align="center"> |
| 20 | + <a href="https://ubuntu.com/download"> |
| 21 | + <img alt="Ubuntu" src="https://img.shields.io/badge/Ubuntu-E95420?style=flat&logo=ubuntu&logoColor=white" /> |
| 22 | + </a> |
| 23 | + <a href="https://www.microsoft.com/pt-br/software-download/windows10"> |
| 24 | + <img alt="Windows" src="https://img.shields.io/badge/Windows-0078D6?style=flat&logo=windows&logoColor=white" /> |
| 25 | + </a> |
| 26 | + </p> |
| 27 | +<p align="center">Did you like the project? Please, considerate <a href="https://www.buymeacoffee.com/hebertcisco">a donation</a> to help improve!</p> |
| 28 | + |
| 29 | +<p align="center"><strong></strong>✨</p> |
| 30 | + |
| 31 | +# Getting started |
| 32 | + |
| 33 | +[](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) |
| 34 | + |
| 35 | +# FastApi + Vercel |
| 36 | + |
| 37 | +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). |
| 38 | + |
| 39 | +[](https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/actions/workflows/python-app.yml) |
| 40 | +[](https://github.com/hebertcisco/deploy-python-fastapi-in-vercel/actions/workflows/docker-image.yml) |
| 41 | + |
| 42 | +## Demo |
| 43 | + |
| 44 | +[deploy-python-fastapi-in-vercel.vercel.app](https://deploy-python-fastapi-in-vercel.vercel.app) |
| 45 | + |
| 46 | +## How it Works |
| 47 | + |
| 48 | +This example uses the Web Server Gateway Interface (WSGI) with FastApi to enable handling requests on Vercel with Serverless Functions. |
| 49 | + |
| 50 | +## Running Locally |
| 51 | + |
| 52 | +### With Docker |
| 53 | +```bash |
| 54 | +# Build the Docker image |
| 55 | +docker build -t deploy-python-fastapi-in-vercel . |
| 56 | + |
| 57 | +# Run the Docker container |
| 58 | +docker run -p 8000:8000 deploy-python-fastapi-in-vercel |
| 59 | + |
| 60 | +``` |
| 61 | + |
| 62 | +### With uvicorn |
| 63 | + |
| 64 | +#### Install dependencies |
| 65 | + |
| 66 | +```bash |
| 67 | +pip install -r requirements.txt |
| 68 | +``` |
| 69 | +```bash |
| 70 | +uvicorn main:app --host 0.0.0.0 --port 8000 |
| 71 | +``` |
| 72 | + |
| 73 | +Your FastApi application is now available at `http://localhost:8000`. |
| 74 | + |
| 75 | +## One-Click Deploy |
| 76 | + |
| 77 | +Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples): |
| 78 | + |
| 79 | +[](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) |
| 80 | + |
| 81 | +## 🤝 Contributing |
| 82 | + |
| 83 | +Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](issues). |
| 84 | + |
| 85 | +## Show your support |
| 86 | + |
| 87 | +Give a ⭐️ if this project helped you! |
| 88 | + |
| 89 | +Or buy me a coffee 🙌🏾 |
| 90 | + |
| 91 | +<a href="https://www.buymeacoffee.com/hebertcisco"> |
| 92 | + <img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=hebertcisco&button_colour=FFDD00&font_colour=000000&font_family=Inter&outline_colour=000000&coffee_colour=ffffff" /> |
| 93 | +</a> |
| 94 | + |
| 95 | +## 📝 License |
| 96 | + |
| 97 | +Copyright © 2023 [Hebert F Barros](https://github.com/hebertcisco).<br /> |
| 98 | +This project is [MIT](LICENSE) licensed. |
0 commit comments