Add a Create Note API

Like some other people here, I’m also getting a “Requested resource not found” error when running $ serverless invoke local --function create --path mocks/create-event.json

I’m not getting a code error, though. I get the caught exception from create.js:

{
    "statusCode": 500,
    "body": "{\"error\":\"Requested resource not found\"}"
}

With some console.logs, I’ve confirmed that my create.js file is receiving the create-event.json data correctly. I’ve also double-checked that my “notes” table actually exists, which I saw was an issue for some people. I feel like I might be missing something simple. Any ideas?

Edit: I figured it out. Apparently, you may need to manually set your AWS region, even if you’ve used all default options throughout the tutorial. In my case, I fixed the issue with the following code:

AWS.config.update({ region: "us-east-2" });

According to AWS’s docs, us-east-2 is the default region for accounts made after May 17, 2017.