• This repository has been archived on 14/Mar/2024
  • Stars
    star
    207
  • Rank 188,749 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A WSGI gateway for the AWS API Gateway/Lambda proxy integration

AWSGI

A WSGI adapter for AWS API Gateway/Lambda Proxy Integration

AWSGI allows you to use WSGI-compatible middleware and frameworks like Flask and Django with the AWS API Gateway/Lambda proxy integration.

Installation

awsgi is available from PyPI as aws-wsgi:

pip install aws-wsgi

Example

import awsgi
from flask import (
    Flask,
    jsonify,
)

app = Flask(__name__)


@app.route('/')
def index():
    return jsonify(status=200, message='OK')


def lambda_handler(event, context):
    return awsgi.response(app, event, context, base64_content_types={"image/png"})