Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1004 Bytes

File metadata and controls

48 lines (30 loc) · 1004 Bytes

Simple Serverless FastApi Example

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

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