기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
2단계: 샘플 애플리케이션 실행
-
AWS Lambda 콘솔의 탐색 패널에서 애플리케이션 을 선택합니다.
-
애플리케이션 페이지의 검색란에서
serverlessrepo-fork-example-ecommerce-
을 검색하여 이 애플리케이션을 선택합니다.my-app
-
리소스 섹션에서 다음을 수행합니다.
-
유형이 ApiGateway RestApi인 리소스를 찾으려면 예를 들어 유형별로 리소스를 정렬
ServerlessRestApi
한 다음 리소스를 확장합니다. -
ApiGateway 배포 유형과 ApiGateway 단계 등 두 개의 중첩 리소스가 표시됩니다.
-
Prod API 엔드포인트 링크를 복사하고 여기에 추가합니다
/checkout
. 예:https://abcdefghij.execute-api.us-east-2.amazonaws.com/Prod/checkout
-
-
라는 파일에 다음을 복사JSON합니다
test_event.json
.{ "id": 15311, "date": "2019-03-25T23:41:11-08:00", "status": "confirmed", "customer": { "id": 65144, "name": "John Doe", "email": "john.doe@example.com" }, "payment": { "id": 2509, "amount": 450.00, "currency": "usd", "method": "credit", "card-network": "visa", "card-number": "1234 5678 9012 3456", "card-expiry": "10/2022", "card-owner": "John Doe", "card-cvv": "123" }, "shipping": { "id": 7600, "time": 2, "unit": "days", "method": "courier" }, "items": [{ "id": 6512, "product": 8711, "name": "Hockey Jersey - Large", "quantity": 1, "price": 400.00, "subtotal": 400.00 }, { "id": 9954, "product": 7600, "name": "Hockey Puck", "quantity": 2, "price": 25.00, "subtotal": 50.00 }] }
-
API 엔드포인트에 HTTPS 요청을 보내려면 예를 들어
curl
명령을 실행하여 샘플 이벤트 페이로드를 입력으로 전달합니다.curl -d "$(cat test_event.json)" https://abcdefghij.execute-api.us-east-2.amazonaws.com/Prod/checkout
는 성공적인 실행을 나타내는 다음과 같은 빈 응답을 API 반환합니다.
{ }