Skip to content

This repository shows an example of an application that executes a trigger when performing an insert in dynamodb.

Notifications You must be signed in to change notification settings

pedrokaroth/heroes-insert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Receiving database events from an insert

This repository shows an example of an application that executes a trigger when performing an insert in dynamodb.

Usage

Deployment

In order to deploy the example, you need to run the following command:

$ serverless deploy

Invocation

After successful deployment, you can invoke the deployed function by using the following command:

npm run insert

Which should result in response similar to the following:

{
    "statusCode": 200,
    "body": [
        {
            "created_at": "2022-12-29T01:12:33.656Z",
            "id": "88dbe52d-0a60-4259-bd9f-32381fe07e81",
            "name": "Batman",
            "power": "Rich"
        }
    ]
}

Local development

You can invoke your function locally by using the following command:

npm run insert-local

Which should result in response similar to the following:

{
    "statusCode": 200,
    "body": [
        {
            "created_at": "2022-12-29T01:12:33.656Z",
            "id": "88dbe52d-0a60-4259-bd9f-32381fe07e81",
            "name": "Batman",
            "power": "Rich"
        }
    ]
}

About

This repository shows an example of an application that executes a trigger when performing an insert in dynamodb.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published