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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인