Skip to content

giambeppo/counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Simple Counter Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages