simple-serverless-fastapi-example icon indicating copy to clipboard operation
simple-serverless-fastapi-example copied to clipboard

A simple FastAPI application using Mangum to run on an AWS Lambda.

Simple Serverless FastApi Example

A simple serverless FastAPI application using Mangum to run on an AWS Lambda.

Complete Walkthrough

Simple Serverless FastAPI with AWS Lambda Complete Walkthrough

Serverless FastAPI CICD with CircleCi Complete Walkthrough

Installation

Setup Virtual Environment

virtualenv -p python3.7 env
source ./env/bin/activate

Install Dependencies

pip install -r requirements.txt

Run the application

uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload

Deploy

Package Dependencies

cd env/lib/python3.7/site-packages
zip -r9 /path/to/root/function.zip

Package Lambda

cd /path/to/root
zip -g function.zip lambda_function.py