Package Exports
- visitor-badge
- visitor-badge/src/main.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (visitor-badge) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
visitor-badge
Warning Since
Detawill abandon Deta Cloud and move to Deta Space, the deta.dev domain is temporarily closed to users, please changevisitor_badge.deta.devtovisitor-badge.imlete.cn
The example service is currently deployed on the free version of Deta, You can visit the /list path to see all the statistics
Inspired by jwenjian/visitor-badge written in Python (PV stats only)
Function
- PV (Number of visits)
- UV (Number of visitors)
- Multi-database selection (mongodb, redis, deta)
Deployment
Deta Free
Server
git clone https://github.com/Lete114/visitor-badge.git visitor-badge
cd visitor-badge
npm run startServerLess
See the other branches of the repository for details
Configuration Database
Rename the .env.example file to .env and edit it (just fill in the comments according to the file)
Use

where
idis custom and it is not constrained in any way.Here are some suggestions
- Specify a user's home page, e.g.: https://github.com/Lete114 using
id=github.lete114- Specify a user's repository, e.g.: https://github.com/Lete114/visitor-badge using
id=github.lete114.visitor-badge- Specify the issues in a user's repository, e.g.: https://github.com/Lete114/visitor-badge/issues/1 using
id=github.lete114.visitor-badge.issues.1- Specify a website, e.g.: https://blog.imlete.cn using
id=blog.imlete.cn- Specify a page of a website, e.g.: https://blog.imlete.cn/404.html using
id=blog.imlete.cn.404
| Key | Default | Required | Options | Description |
|---|---|---|---|---|
| id | ✅ | Page unique ID | ||
| type | pv | ['pv', 'uv'] | Statistics type | |
| label | visitors | Custom label (left) name | ||
| labelColor | 555 | Custom label (left) color (Note: You can leave out the well number #) |
||
| color | 4c1 | Custom stats (right side) color (Note: You can leave out the well number #) |
||
| style | flat | ['plastic', 'flat', 'flat-square', 'for-the-badge', 'social'] | Custom badge style |