Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 1.43 KB

README.md

File metadata and controls

49 lines (31 loc) · 1.43 KB

Counter.io

A simple counter service.

Allows to create and update counters that are persisted and can be shared.

Build and run

Build with mvn package

Run with java -jar target/counter-1.0-SNAPSHOT.jar

Available methods

Create a counter

Returns HTTP 201 if successful, HTTP 409 if the counter exists already.

New counters are initialized with value 0.

Get a counter value

Returns the value of the counter, or HTTP 404 if the counter does not exist.

Update a counter value

All the following methods return HTTP 404 if the counter does not exist.

Increase a counter value

Increment the value of a counter by 1, returning the new value.

Decrease a counter value

Decrement the value of a counter by 1, returning the new value.

Set a specific counter value

Sets the counter value to the long provided in the body or in the query parameter, respectively, and returns it.

Delete a counter

Returns HTTP 204 if successful, or HTTP 404 if the counter does not exist.