def lambda_handler()

in docdb_rest/app.py [0:0]


def lambda_handler(event, context):
    print(event)
    httpMethod = event["httpMethod"]
    retval = "Done"
    if "GET" == httpMethod:
        retval = handle_get(event)
    elif "PUT" == httpMethod:
        retval = handle_post(event)
    elif "POST" == httpMethod:
        retval = handle_post(event)
    elif "PATCH" == httpMethod:
        retval = handle_patch(event)
    elif "DELETE" == httpMethod:
        retval = handle_delete(event)
    print(retval)

    return {
        'statusCode': 200,
        'body': json.dumps(retval)
    }