-
Install Golang & Redis
-
Run
go mod install
to install the dependencies -
Run
air
(if installed) orgo build
to build and run the API locally. -
The API will be running on
http://0.0.0.0:8080
by default.
Abacus is a simple counting API written in Golang. It is a simple REST API that allows you to create, read, update and delete counts. It is a simple project that I created to learn Nim Go and to get a feel for the language.
I currently use it on my personal website to keep track of the number of visitors.
- Documentation
-
K8 Deployment(Render + Redis on OCI) - JSONP Support (https://gin-gonic.com/docs/examples/jsonp/)
- impl /create endpoint which creates a new counter initialized to 0 and returns a secret key that can be used to modify the counter via the following endpoints
- /delete endpoint
- /set endpoint
- /reset (alias to /set 0)
- /update endpoint (updates the counter x)
- SSE Stream for the counters? Low priority.
- Tests
- Rate limiting (max 30 requests per 3 second per IP address)
- Create Python & JS Wrappers