Skip to content

Proxy Forwarding with 1 resource and route inside Chalice #1959

@AndreuJove

Description

@AndreuJove

Dear chalice,

I was wondering if it's possible to have only one resource in the API GATEWAY using {proxy+} integration and route the traffic inside chalice.

The point is not to create each time a new resource for each endpoint (new infrastructure to deploy). I wan't to manage the routes inside my chalice application.

When I try to route using:

@app.route('/a', methods=["GET"])
def a():
    return {
        'statusCode': 200,
        'body': json.dumps('Hello a!')
    }

The response recieved is:

{
  "Code": "MethodNotAllowedError",
  "Message": "Unsupported method: GET"
}

When accessing the index it works:

@app.route('/')
def index():
    return {
        'statusCode': 200,
        'body': json.dumps('Hola chalice!')
    }

Response:

{
  "statusCode": 200,
  "body": "\"Hola chalice!\""
}

The proxy configuration that I would like to use:
image

Thanks a lot!!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions