You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
'use strict';
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};
callback(null, response);
// Use this code if you don't use the http event with the LAMBDA-PROXY integration
// callback(null, { message: 'Go Serverless v1.0! Your function executed successfully!', event });
};
런타임은 3개의 인수를 핸들러 메서드에 전달합니다. 첫 번째 인수는 호출자로부터의 정보가 포함된 event 객체입니다. 이 정보는 Invoke를 호출할 때 호출자가 JSON 형식 문자열로 전달하고, 런타임은 이 정보를 객체로 변환합니다. AWS 서비스가 함수를 호출할 때, 이벤트 구조는 서비스별로 상이합니다.
두 번째 인수는 컨텍스트 객체이며, 여기에는 호출, 함수 및 실행 환경에 대한 정보가 포함되어 있습니다. 이전 예제에서는, 함수가 컨텍스트 객체로부터 로그 스트림의 이름을 가져와서 호출자에게 반환합니다.
세 번째 인수 callback은 응답을 전송하기 위해 비동기 이외의 핸들러에서 호출할 수 있는 함수입니다. 콜백 함수는 두 개의 인수, Error 및 응답을 사용합니다. 호출하면 Lambda는 이벤트 루프가 비워질 때까지 기다린 다음 응답이나 오류를 호출자에게 반환합니다. 응답 객체는 JSON.stringify와 호환되어야 합니다.
No description provided.
The text was updated successfully, but these errors were encountered: