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 年前3087 查看次数
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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则