County is a simple counter service that allows you to increment and retrieve counts for a given namespace and key.
- Increment a count for a given namespace and key.
- Retrieve the current count for a given namespace and key.
bun install
To run:
bun dev
The API is deployed at https://county.hawari.dev.
Retrieve the current count for a given namespace and key.
namespace
(string, required): The namespace of the counter.key
(string, required): The key of the counter.
- 200 OK
{ "count": number }
- 400 Bad Request
- Missing
namespace
{ "message": "namespace parameter is required" }
- Missing
key
{ "message": "key parameter is required" }
- Missing
Increment the count for a given namespace and key. If the counter does not exist, it will be created with an initial value of 1.
namespace
(string, required): The namespace of the counter.key
(string, required): The key of the counter.
- 200 OK
"OK"
- 400 Bad Request
- Missing
namespace
{ "message": "namespace parameter is required" }
- Missing
key
{ "message": "key parameter is required" }
- Missing
- 404 Not Found
{ "message": "Not Found" }