Skip to content

andrewevans0102/building-an-api-with-serverless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building an API with the Serverless Framework

This is a companion project to my blog post building an api with the serverless framework.

Check out my post and the serverless getting started page for more.

This API has basic endpoints for Create, Read, Update, and Delete (CRUD) operations. Its a very simple meal planning API.

If you follow along in my post, the body that is returned from the API generally looks like this:

[
  {
    "updatedAt": 1625837107257,
    "username": "1234",
    "meals": [
      {
        "lunch": "sandwhich",
        "breakfast": "cereal",
        "day": "0",
        "dinner": "chicken"
      },
      {
        "lunch": "",
        "breakfast": "",
        "day": "1",
        "dinner": ""
      },
      {
        "lunch": "",
        "breakfast": "",
        "day": "2",
        "dinner": ""
      },
      {
        "lunch": "",
        "breakfast": "",
        "day": "3",
        "dinner": ""
      },
      {
        "lunch": "",
        "breakfast": "",
        "day": "4",
        "dinner": ""
      },
      {
        "lunch": "",
        "breakfast": "",
        "day": "5",
        "dinner": ""
      },
      {
        "lunch": "pizza",
        "breakfast": "oatmeal",
        "day": "6",
        "dinner": "lasagna"
      }
    ]
  }
]

When you call the create endpoint it will create a blank set of values to start with. Just make sure to pass a username as that will be how the data is keyed in DyanmoDB. Here is a sample body for the create endpoint:

{
  "username": "1234"
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages