Skip to content

This project uses the Serverless Framework to deploy an entire Flask application to Lambda, fronted by an API Gateway

License

Notifications You must be signed in to change notification settings

srijitm/sample-flask-lambda-api

Repository files navigation

Sample Flask Fargate API

Note: This is not Production grade and simply meant as a demo

Description

This project demonstrates how a Flask application can be deployed to Lambda without re-writing. An API Gateway sits infront and simply routes all requests to the Lambda function. The Lambda function itself uses the routes (as defined in Flask). This application provides endpoints to upload/download an image (jpeg) to/from S3.

Usage

Postman collection is included. Just update the URL to point to your API Gateway endpoint. The sls deploy command output will contain the endpoint.

Instructions

npm install -g serverless
npm install serverless-wsgi serverless-python-requirements --save-dev
  • Update app.py (line 7) to point to an existing S3 bucket
bucket = 'my-playpen'
  • Deploy (from root dir)
sls deploy

About

This project uses the Serverless Framework to deploy an entire Flask application to Lambda, fronted by an API Gateway

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages