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?

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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ