Skip to content

MatthewPlemmons/sls-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Serverless Test

Simple project testing out AWS Lambda functions, API Gateway and the Serverless framework. Use url endpoints to perform basic operations on a DynamoDB table.

Setup

Install the Serverless framework.

npm install serverless -g

Deploy

Run this command to package up the service and deploy it to AWS servers.

serverless deploy

Usage

Use the curl command to access the database operations at each endpoint. The following database operations are available.

Create

Save a new database item. Requires name and country values.

# Replace `xyz` with the unique id generated by Serverless.
curl -X POST https://xyz.execute-api.us-east-1.amazonaws.com/dev/api --data '{ "name": "Matthew", "country": "USA" }'

List

Return a list of all current database items.

curl https://xyz.execute-api.us-east-1.amazonaws.com/dev/api

Get

Fetches a single item from the database.

# Replace <id> with the item's uuid number.
curl https://xyz.execute-api.us-east-1.amazonaws.com/dev/api/<id>

Delete

Erases an item from the database.

curl -X DELETE https://xyz.execute-api.us-east-1.amazonaws.com/dev/api/<id>

Credits

Excellent documentation on Serverless for AWS deployment found here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors