/onehit

Hit-counter as a Service

Primary LanguageGo

onehit logo donuts-are-good's followers donuts-are-good's stars donuts-are-good's visitors

onehit

onehit is a hit counter as a service. It provides an HTTP API that allows you to increment and track hits for any arbitrary "key". This can be useful for tracking page views, downloads, or any other metric you want to count.

how it Works

onehit is built on top of libkeva, a lightweight key-value store library for Go. libkeva provides a thread-safe API for storing and retrieving arbitrary data, which makes it a perfect fit for a hit counter service like onehit.

When a GET request is made to a path starting with /x/, onehit increments the hit count for the key specified in the rest of the path. The current hit count for the key is then returned in the response.

usage

To use onehit, simply start the service and make a GET request to the /x/{your-key} endpoint, replacing {your-key} with the key you want to track. For example:

curl http://localhost:3589/x/my-page

This will increment the hit count for "my-page" and return the current count.

deployment

For easy deployment with automatic HTTPS support, try serving onehit with appserve, an easy application server that handles HTTPS for you automatically.

license

mit license 2023 donuts-are-good