You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
Activity
domderen commentedon Mar 25, 2018
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.
huhuhong commentedon Mar 27, 2018
Let's say I have route below
/Home
/Room/(id)
So I would need to define api gateway path:
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.
domderen commentedon Apr 9, 2018
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/3to return a specific HTML for your path.