Serverless gateway for a CRUD API that maintains my garden's data
This API was built to serve and recieve data entries from various IOT sensors. The data's schema is very simple and expected to be arrive on a semi-regular basis. Data is meant to be accessible by everyone, but modified only by authenticated users. Data is sent to the API autonomously, so creation of entries requires only an API key. However, detetion and modification of data, both user actions, requires an Oauth token to be sent with the request.
This API is currently hosted with AWS Lambda, so the authorized functions found in the authentication module are used to grant or deny access.
The project utilizes the Serverless
framework. Assuming you have Serverless
installed
and your AWS account confiured, installation requires only a single command.
serverless deploy
Make sure to update the api
authorizers with your authentication function's URL.
curl -X POST https://XXXX.execute-api.region.amazonaws.com/dev/datum --data '{ }'
curl https://XXXX.execute-api.region.amazonaws.com/dev/datum
curl https://XXXX.execute-api.region.amazonaws.com/dev/datum/<id>
curl -X PUT https://XXXX.execute-api.region.amazonaws.com/dev/datum/<id> --data '{}'
curl -X DELETE https://XXXX.execute-api.region.amazonaws.com/dev/datum/<id>
PRs accepted.
MIT © Ben Carothers