Skip to content

Instantly share code, notes, and snippets.

@alexdlaird
Last active July 14, 2020 18:17
Show Gist options
  • Save alexdlaird/085abd0733f7b93efa51edacab3adf75 to your computer and use it in GitHub Desktop.
Save alexdlaird/085abd0733f7b93efa51edacab3adf75 to your computer and use it in GitHub Desktop.
AWS Lambda Flask integration example for pyngrok, full documentation found at https://pyngrok.readthedocs.io/en/latest/integrations.html
import json
from flask import Blueprint, request
from lambdas.foo_GET import lambda_function as foo_GET
bp = Blueprint("lambda_routes", __name__)
@bp.route("/foo")
def route_foo():
# This becomes the event in the Lambda handler
event = {
"someQueryParam": request.args.get("someQueryParam")
}
return json.dumps(foo_GET.lambda_handler(event, {}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment