Hi, anyone has similiar issue ? I just deploy a simple service for a basic REST API, following a tutorial.
but when call it through CURL, it return error as below:
HTTP/1.1 502 Bad Gateway
Connection: keep-alive
Content-Length: 36
Content-Type: application/json
Date: Sat, 29 Jul 2017 17:24:45 GMT
Via: 1.1 73ca6a49ae80fd49bc58c66f9c46c2bf.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 5LHHMS0aOmcyEv78mJBF1J0gwC-u2zL5ltLmGBNwHyEr5yMdIr70Pw==
X-Cache: Error from cloudfront
x-amzn-RequestId: cf9d4393-7482-11e7-b27e-112c20856a3f
{
"message": "Internal server error"
}
I have met similar issue for many times following different tutorial. the only change is runtime from node4.3 to node6.10 and region from us-east-1 to ap-northeast-2.
below the yml file and handler:
service: candidate-service
frameworkVersion: ">=1.1.0 <2.0.0"
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: ap-northeast-1
functions:
candidateSubmission:
handler: api/candidate.submit
memorySize: 128
description: Submit candidate information and starts interview process.
events:
- http:
path: candidates
method: post
'use strict';
module.exports.submit = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};
callback(null, response);
};
thanks.