Code Monkey home page Code Monkey logo

hebertcisco / deploy-python-fastapi-in-vercel Goto Github PK

View Code? Open in Web Editor NEW
86.0 1.0 51.0 30 KB

This example shows how to use FastApi on Vercel with Serverless Functions using the Python Runtime

Home Page: https://deploy-python-fastapi-in-vercel.vercel.app/docs

License: MIT License

Python 82.79% Dockerfile 17.21%
fastapi fastapi-boilerplate fastapi-template fastapi-users vercel vercel-deployment vercel-hosting vercel-serverless vercel-serverless-api vercel-serverless-functions

deploy-python-fastapi-in-vercel's Introduction

:package: deploy-python-fastapi-in-vercel

๐Ÿ“ฆ deploy-python-fastapi-in-vercel

This example shows how to use FastApi on Vercel with Serverless Functions using the Python Runtime.

Issues GitHub pull requests
Report Bug Request Feature

Systems on which it has been tested.

Ubuntu Windows

Did you like the project? Please, considerate a donation to help improve!

โœจ

Getting started

Deploy with Vercel

FastApi + Vercel

This example shows how to use FastApi 0.88.0 on Vercel with Serverless Functions using the Python Runtime.

Python testing Docker Image CI

Demo

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 Compose

docker-compose up

With Docker

# 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

pip install -r requirements.txt
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:

Deploy with Vercel

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!

Or buy me a coffee ๐Ÿ™Œ๐Ÿพ

๐Ÿ“ License

Copyright ยฉ 2024 Hebert F Barros.
This project is MIT licensed.

deploy-python-fastapi-in-vercel's People

Contributors

dependabot[bot] avatar hebertcisco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

deploy-python-fastapi-in-vercel's Issues

I got a 500 internal error while doing a nd deploy

i have cloned your project . and I want to know if it really works . but seems to get error error like this

root@minto-Lenovo-V145-14AST:/home/minto/belajar/colongan/deploy-python-fastapi-in-vercel# vercel dev
Vercel CLI 28.10.1
> Ready! Available at http://localhost:3000
> Building @vercel/python@latest:api/index.py
Installing required dependencies...
> Built @vercel/python@latest:api/index.py [1m]
using Asynchronous Server Gateway Interface (ASGI)
<class 'TypeError'>
TypeError: Object prototype may only be an Object or null: undefined
    at Function.setPrototypeOf (<anonymous>)
    at new LambdaError (/usr/local/lib/node_modules/vercel/dist/index.js:9679:16)
    at Lambda.<anonymous> (/usr/local/lib/node_modules/vercel/dist/index.js:9812:27)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/vercel/dist/index.js:9726:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
<class 'TypeError'>
TypeError: Object prototype may only be an Object or null: undefined
    at Function.setPrototypeOf (<anonymous>)
    at new LambdaError (/usr/local/lib/node_modules/vercel/dist/index.js:9679:16)
    at Lambda.<anonymous> (/usr/local/lib/node_modules/vercel/dist/index.js:9812:27)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/vercel/dist/index.js:9726:58)

and when running at local time it gets the same error too, what's the solution

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.