AWS-Serverless-API

A serverless AWS expense tracker API.

  1. AWS Lambda functions
  2. API gateway
  3. Dynamodb

Endpoints

Create a new expense: Method: POST

Body format: JSON

sample body request.

{
 "description": "Car servicing",
 "amount": "540"
}

Status code: 201

Get all expenses: Method: GET

sample response.

[
    {
        "amount": "5000",
        "description": "Medical bills",
        "id": "eda2769d-3d97-4082-bc9f-97c52b9a9274"
    },
    {
        "amount": "540",
        "description": "Car servicing",
        "id": "eedb412d-ad57-4a62-b4b1-3ff734a7ba76"
    }
]

Status code: 200

Get an expense: Method: GET

Endpoint : https://553y9ozxl7.execute-api.us-west-2.amazonaws.com/expenses/{expenseID}

sample response.

{
    "amount": "540",
    "description": "Car servicing",
    "id": "eedb412d-ad57-4a62-b4b1-3ff734a7ba76"
}

Status code: 200

Update an expense: Method: PUT

Body format: JSON

sample body request.

{
 "description": "Update on Car servicing",
 "amount": "5300"
}

Status code: 200

Delete an expense: Method: DELETE

Endpoint : https://553y9ozxl7.execute-api.us-west-2.amazonaws.com/expenses/{expenseID}

Status code: 204

GitHub

View Github