Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

status 502 bad api gateway error solution for aws lambda

// status 502 bad api gateway error solution for aws lambda

exports.handler = async (event) => {
    const response = {
        statusCode: 200,
        headers: {
            "Access-Control-Allow-Headers" : "Content-Type",
            "Access-Control-Allow-Origin": "https://www.example.com",
            "Access-Control-Allow-Methods": "OPTIONS,POST,GET"
        },
        body: JSON.stringify('Hello from Lambda!'),
    };
    return response;
};
Source by docs.aws.amazon.com #
 
PREVIOUS NEXT
Tagged: #status #bad #api #gateway #error #solution #aws #lambda
ADD COMMENT
Topic
Name
2+7 =