AnomalyInnovations / serverless-stack-demo-api

Source for the demo app API in the Serverless Stack Guide
https://demo.serverless-stack.com
MIT License
517 stars 197 forks source link

Create API Local Test #8

Closed ghost closed 7 years ago

ghost commented 7 years ago

Following this page: https://serverless-stack.com/chapters/add-a-create-note-api.html

When running: serverless invoke local --function create --path mocks/create-event.json It returns:

{
    "statusCode": 500,
    "headers": {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Credentials": true
    },
    "body": "{\"status\":false}"
}

I checked: ~/.aws/credentials

~/.aws/config region=us-east-1

In serverless.yml: region=us-east-1 as well

In create.js: region=us-east-1 as well

There are no other helpful messages that tell me why it returned statusCode 500.

Please help. Thanks.

jayair commented 7 years ago

@bgail 500 errors should be straightforward to debug. You can try adding a console.log to see what is going on. Here is some more info on it https://serverless-stack.com/chapters/add-a-create-note-api.html#common-issues