Python Flask API service, backed by DynamoDB, running on AWS Lambda using the traditional Serverless Framework.
-
List all items with the
org_id
provided.Example:
curl -H "Content-Type: application/json" -u username:apikey -X GET https://woo6lrrukc.execute-api.eu-west-1.amazonaws.com/api/favourite_company/amazon
-
Method to create an item in the database.
Example:
curl -H "Content-Type: application/json" -u username:apikey -X POST https://woo6lrrukc.execute-api.eu-west-1.amazonaws.com/api/favourite_company/create -d '{"org_id": "amazon", "favourite_org_id": "facebook"}'
-
List all items of the table.
Example:
curl -H "Content-Type: application/json" -u username:apikey -X GET https://woo6lrrukc.execute-api.eu-west-1.amazonaws.com/api/favourite_companies
-
Delete the item of the database with the
org_id
and thefavourite_org_id
provided.Example:
curl -H "Content-Type: application/json" -u username:apikey -X DELETE https://woo6lrrukc.execute-api.eu-west-1.amazonaws.com/api/favourite_company/delete/amazon/facebook
- partition key -> org_id
- sort key -> favourite_org_id
sls wsgi serve
sls deploy
serverless config credentials --provider aws --key {key} --secret {secret}
Check the credentials:
cat ~/.aws/credentials
To install them:
serverless plugin install -n serverless-python-requirements
serverless plugin install -n serverless-wsgi
serverless plugin install -n serverless-basic-authentication