Deta micro
app that counts page hits(views). Can generate badge
or json response with counter.
Badge need to be generated each time when page with link is loaded, so caching is omitted.
Due to this, app NOT USE
redirects to badgen.net, but instead create badge by herself.
โก Single deta micro may have rate-limit, so if You want to heavily use counter, please, deploy it to Deta Space by yourself. โก
url /:key/badge?label=...&labelColor=...&color=...&style =...&noIncrement=...
Param name | Description | Default value | |
---|---|---|---|
key |
Required | Unique key for this counter. Path param. | - |
label |
Optional | badgen | "views" |
labelColor |
Optional | badgen | "#555" |
color |
Optional | badgen | "blue" |
style |
Optional | badgen | "classic" |
icon |
Optional | badgen | - |
iconWidth |
Optional | badgen | 13 |
scale |
Optional | badgen | 1 |
gradient |
Optional | gradient-badge | - |
noIncrement |
Optional | To not increment counter. | false |
url /:key?noIncrement=...
Have only two params: key
and noIncrement
.
Response:
{
"counter": 123
}
โ noIncrement
may be needed when You just want to fetch counter without incrementing it,
so You can implement logic on front-end of your app to catch only unique visitors.
NITRO_DETA_PROJECT_KEY/DETA_PROJECT_KEY
- Your project from Deta web settings.NITRO_DETA_BASE_NAME
- Optional. Name ofDeta Base
.NITRO_ALLOW_ORIGIN
- Optional. Default*
.
- Gradient badges from bokub/gradient-badge
- Icons