Skip to content

Latest commit

 

History

History
42 lines (21 loc) · 1.54 KB

README.md

File metadata and controls

42 lines (21 loc) · 1.54 KB

FastAPI Vercel Template

This is a template repository to get up an running with FastAPI + Vercel with sensible defaults.

It comes with one route, system status, that can be used as a health check endpoint.

Deploying to Vercel

First, make sure you have the Vercel CLI installed. Then run the following command.

make deploy

Vercel does not work with Python Poetry so a requirements file will need to be generated. The deploy make target will generate a requirements.txt file prior to deploying. This is also added to the .gitignore file so will be ignored by source control.

You can also deploy to prod using the PROD env var

PROD=1 make deploy

Running the app locally

The app can be started from the command line with the following command.

make run

There is also a VSCode launch configuration that you can use to run using the debugger.

Testing

Testing is configured using Pytest and can be run with the following command

make test

You can run coverage and view the report in a browser by setting the COVERAGE env var.

COVERAGE=1 make test

Formatting

The project is configured to use black, autoflake and isort and can be run using the following

make fmt