Skip to content

testkun08080/FastAPI-vercel

Repository files navigation

概要

FastAPIをvercel上へデプロイする流れと、サンプルデータです。

テンプレートを使って、とりあえずデプロイしたい方

Deploy with Vercel

サンプルページ

https://fast-api-vercel-murex.vercel.app/

事前インストール必要なもの

  • Python 3.12 (vercelの最新が3.12対応のため - 2025/6/3)
  • uv (インストールはこちら)
  • Vercel CLI (インストールはこちら)

ローカル上でセットアップから起動

  1. ローカルへクローンする

    git clone https://github.com/testkun08080/FastAPI-vercel.git
  2. 仮想環境の構築

    cd FastAPI-vercel
    uv venv -p 3.12
    uv pip install -r requirements.txt
  3. 起動

    uv run -m api.app.main

Pytestを使ったテスト

  1. テスト用にモジュールをインストール
    uv pip install -r requirements_test.txt
  2. Pytest実行
    uv run pytest --html=report.html --self-contained-html --log-level=INFO

Vercel CLI を使ってテストからデプロイ

  1. ローカルでテスト

    vercel dev
  2. vercelへデプロイ(プレビューとして)

    vercel
  3. 、vercelへデプロイ(プロダクトとして)

    vercel --prod

About

FastAPI-vercel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published