A simple counter service based on AWS lambda and DynamoDB.
Allows to create and update counters that are persisted and can be shared.
Returns HTTP 201
if successful, HTTP 409
if the counter exists already.
New counters are initialized with the value provided in the query parameter, or 0 if the parameter is not provided.
Returns the value of the counter, or HTTP 404
if the counter does not exist.
All the following methods return HTTP 404
if the counter does not exist.
Increment the value of a counter by 1, returning the new value.
Decrement the value of a counter by 1, returning the new value.
POST
http://my.api.gateway?counter=myCounter&value=666GET
http://my.api.gateway?counter=myCounter&after=set&newValue=666
Sets the counter value to the long provided in the query parameter and returns it.
Returns HTTP 204
if successful, or HTTP 404
if the counter does not exist.