Http API Gateway with lambda integration for multiple routes

0

Customer uses Express (specifically using aws-serverless-express) with Lambda and HTTP API Gateway. The Lambda function handles several routes and Express is handling the internal routing according to the path.

Is it possible in HTTP API Gateway to add the base URL and let the Lambda route based on the path?

AWS
已提問 3 年前檢視次數 2995 次
1 個回答
0
已接受的答案

HTTP API contains a $default route that will be used when no other route matches the request. You can create a single integration and map it to the $default route. You can use specific methods or you can use the ANY method. See more here.

You can also use greedy path variables as described here. This will let you have several functions each handling a different part of the API (if needed), e.g., /users/{proxy+} will be routed to a function handling users, and /pets/{proxy+} to a function handling pets.

profile pictureAWS
專家
Uri
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南