Skip to main content

Library to run applications on AWS Lambda Function using Flask

Project description

aws_flask_lambda

Version 0.1.3 updates Flask and werkzeug version requirements to 3.0.3 and updates werkzeug.wrappers import, from base_request.py to request.py

Version 0.1.4 fixes an error when extracting the event['body'] on the AWS environment request, on the environ variable 'wsgi.input'

Installation

Install the package using pip:

pip install aws-flask-lambda

Usage

from aws_flask_lambda import FlaskLambda
from flask import request, jsonify

app = FlaskLambda(__name__)


@app.route('/greet', methods=['GET', 'POST'])
def greet():
    name = request.form.get('name', 'World')
    message = f'Hello, {name}!'
    return (
        jsonify({'message': message}),
        200,
        {'Content-Type': 'application/json'}
    )


if __name__ == '__main__':
    app.run(debug=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_flask_lambda-0.1.4.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page