Skip to content

Aws Api gateway route #3

Open
Open

Description

@huhuhong

Hi,

I would assume you expose lambda function via AWS API Gateway. May I know how many endpoint path you define in API gateway to route different static page like home, about and etc.

Activity

  1. domderen commented on Mar 25, 2018

    @domderen
    Owner

    It can be just a single API Gateway endpoint, as all the request details are passed to the Lambda, so from there you are able to perform routing based on the path that was entered in the URL. And API Gateway can be configured to always pass all routes to the same Lambda function.

  2. huhuhong commented on Mar 27, 2018

    @huhuhong
    Author

    Let's say I have route below
    /Home
    /Room/(id)

    So I would need to define api gateway path:

    1. /home
    2. /Room/(path variable for id)

    What if I add context route path:
    /Base/home
    /Base/room/(Id)

    Can I just configure a single API gateway path which is /base to accept both route? I trying to avoid have to configure multiple API gateway path whenever I introduce new route.

  3. domderen commented on Apr 9, 2018

    @domderen
    Owner

    As far as I remember you can configure such paths in APIG:

    • /{variable1}
    • /{variable1}/{variable2}
    • /{variable1}/{variable2}/{variable3}

    And point all of them to your Lambda. Next use variable1/2/3 to return a specific HTML for your path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions