Home

Awesome

Another Lambda Python Horrible Router Naivety

Build Status codecov

Alphorn is a simple Python package to handle Lambda invocations routed by the AWS API Gateway with a {proxy+} configuration.

This package takes free inspiration (read: steals code) from Chalice and Lambdarest but only attempts to implement routing functionalities, hence having a naive approach, remaining very simple, and probably lacking loads of features.

How to use

define your lambda.py file as below, and configure your AWS lambda handler to be lambda.run

from alphorn import Alphorn

app = Alphorn()

@app.route('/sample/{greeting}')
def sample(greeting):
    return {
        'message': str(greeting),
    }

def run(event, context):
    """lambda handler
    """
    return app.handle(event)