{"id":28497007,"url":"https://github.com/itning/hit-count","last_synced_at":"2026-04-26T08:38:49.236Z","repository":{"id":40692445,"uuid":"407083876","full_name":"itning/hit-count","owner":"itning","description":"仓库访问频次计数徽章","archived":false,"fork":false,"pushed_at":"2025-05-28T13:47:56.000Z","size":541,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-08T12:42:47.021Z","etag":null,"topics":["hit-counter","javascript","node"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-16T08:24:43.000Z","updated_at":"2025-05-28T13:47:54.000Z","dependencies_parsed_at":"2024-04-17T08:40:46.723Z","dependency_job_id":"2e824680-4a89-42ff-a4f3-8ef5943b3b2a","html_url":"https://github.com/itning/hit-count","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itning/hit-count","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Fhit-count","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Fhit-count/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Fhit-count/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Fhit-count/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itning","download_url":"https://codeload.github.com/itning/hit-count/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Fhit-count/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263218033,"owners_count":23432417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hit-counter","javascript","node"],"created_at":"2025-06-08T12:31:55.315Z","updated_at":"2026-04-26T08:38:44.204Z","avatar_url":"https://github.com/itning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hit count\n\n[![GitHub stars](https://img.shields.io/github/stars/itning/hit-count.svg?style=social\u0026label=Stars)](https://github.com/itning/hit-count/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/itning/hit-count.svg?style=social\u0026label=Fork)](https://github.com/itning/hit-count/network/members)\n[![GitHub watchers](https://img.shields.io/github/watchers/itning/hit-count.svg?style=social\u0026label=Watch)](https://github.com/itning/hit-count/watchers)\n[![GitHub followers](https://img.shields.io/github/followers/itning.svg?style=social\u0026label=Follow)](https://github.com/itning?tab=followers)\n\n[![GitHub issues](https://img.shields.io/github/issues/itning/hit-count.svg)](https://github.com/itning/hit-count/issues)\n[![GitHub license](https://img.shields.io/github/license/itning/hit-count.svg)](https://github.com/itning/hit-count/blob/master/LICENSE)\n[![GitHub last commit](https://img.shields.io/github/last-commit/itning/hit-count.svg)](https://github.com/itning/hit-count/commits)\n[![GitHub repo size in bytes](https://img.shields.io/github/repo-size/itning/hit-count.svg)](https://github.com/itning/hit-count)\n[![language](https://img.shields.io/badge/language-JavaScript-green.svg)](https://github.com/itning/hit-count)\n\n## 简介\n\n仓库访问频次计数徽章\n\n效果：\n![hitCount](https://hitcount.itning.com/?u=itning\u0026r=hit-counts)\n\n## 如何部署自己的计数器？\n\n### 使用腾讯云函数\n\n使用[腾讯云函数](https://console.cloud.tencent.com/scf/)实现，后端采用redis计数\n\n#### 前提\n\n1. 有能够使云函数访问的Redis服务器，点我查看如何白嫖Redis服务器\n2. 腾讯云账号\n\n或者你有服务器那直接部署在服务器上即可，不需要腾讯云函数。\n\n#### 步骤\n\n1. 克隆仓库到本地\n\n   `git clone https://github.com/itning/hit-count.git`\n\n2. 进入目录中\n\n   `cd ./hit-count/tencent-cloud-serverless-redis/src`\n\n3. 安装依赖\n\n   `npm install`\n\n4. 修改redis的访问路径\n\n   修改`app.js`文件\n\n   ```javascript\n   const redisStore = new redis({\n       port: 16320, // Redis instance port, redis实例端口\n       host: \"\", // Redis instance host, redis实例host\n       family: 4, // 4 (IPv4) or 6 (IPv6)\n       password: \"\", // Redis instance password, redis实例密码\n       db: 0\n   });\n   ```\n\n5. 添加访问域名白名单\n\n   修改`app.js`文件\n\n   ```javascript\n   const authorWhitelist = [\"itning\"];\n   ```\n\n   默认是作者自己，需要修改下\n\n6. 安装腾讯云SLS\n\n   `npm install -g serverless`\n\n7. 上传\n\n   `serverless deploy --debug`\n\n8. 进入腾讯云控制台查看结果\n\n### 使用服务器\n\n#### 前提\n\n1. 有个服务器\n2. 有个公网IP\n3. 有个域名（可选）\n\n#### 步骤\n\n1. 克隆仓库到本地\n\n   `git clone https://github.com/itning/hit-count.git`\n\n2. 进入目录\n\n   `cd ./hit-count/server-redis`\n\n3. 安装依赖\n\n   `npm install`\n\n4. 修改redis的访问路径\n\n   修改`app.js`文件\n\n   ```javascript\n   const redisStore = new redis({\n       port: 16320, // Redis instance port, redis实例端口\n       host: \"\", // Redis instance host, redis实例host\n       family: 4, // 4 (IPv4) or 6 (IPv6)\n       password: \"\", // Redis instance password, redis实例密码\n       db: 0\n   });\n   ```\n\n5. 添加访问域名白名单\n\n   修改`app.js`文件\n\n   ```javascript\n   const authorWhitelist = [\"itning\"];\n   ```\n\n   默认是作者自己，需要修改下\n\n6. 启动\n\n   `node app.js`\n   \n7. 后台运行（可选）\n\n   ```shell\n   # 安装pm2\n   npm install -g pm2\n   # 后台运行\n   pm2 app.js -o ./app.log -e error.log\n   ```\n### 使用CloudFlare Workers\n\n1. 克隆仓库到本地\n\n   `git clone https://github.com/itning/hit-count.git`\n\n2. 进入目录中\n\n   `cd ./hit-count/hit-count-cf-worker`\n   \n4. 安装依赖\n\n   `npm install`\n\n5. 部署\n\n   `npm run deploy`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitning%2Fhit-count","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitning%2Fhit-count","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitning%2Fhit-count/lists"}