{"id":14989477,"url":"https://github.com/hugh888888/vercelkoa2template","last_synced_at":"2026-02-17T06:05:46.871Z","repository":{"id":253361651,"uuid":"843212767","full_name":"hugh888888/VercelKoa2Template","owner":"hugh888888","description":"A template that can deploy koa2 on vercel, supports connecting to redis and mongodb, no server required, and uses vercel to build backend interface services for free","archived":false,"fork":false,"pushed_at":"2024-08-16T10:17:44.000Z","size":199,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T06:31:41.839Z","etag":null,"topics":["koa2","mongodb","nodejs","nodejs-server","redis","vercel"],"latest_commit_sha":null,"homepage":"https://template.li-h.me","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hugh888888.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}},"created_at":"2024-08-16T02:51:36.000Z","updated_at":"2024-08-16T10:17:46.000Z","dependencies_parsed_at":"2024-09-15T16:04:52.505Z","dependency_job_id":"4e20ae06-daea-4a13-9d44-3987be2e32fc","html_url":"https://github.com/hugh888888/VercelKoa2Template","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"366f060a069d593f5980e77f41ed6b8036c391ce"},"previous_names":["hugh888888/vercelkoa2template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugh888888%2FVercelKoa2Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugh888888%2FVercelKoa2Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugh888888%2FVercelKoa2Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugh888888%2FVercelKoa2Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugh888888","download_url":"https://codeload.github.com/hugh888888/VercelKoa2Template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238937490,"owners_count":19555376,"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":["koa2","mongodb","nodejs","nodejs-server","redis","vercel"],"created_at":"2024-09-24T14:18:25.819Z","updated_at":"2025-10-10T10:36:56.134Z","avatar_url":"https://github.com/hugh888888.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eVercel Koa2 Template\u003c/h1\u003e\n  \u003cp\u003e\u003ca href=\"https://template.li-h.me/\"\u003epreview\u003c/a\u003e · \u003ca href=\"https://github.com/hugh888888/VercelKoa2Template/blob/master/readme_en.md\"\u003eEnglish\u003c/a\u003e | 简体中文\u003c/p\u003e\n  \u003cp\u003e一个可以在vercel上部署koa2的模板，支持连接redis和mongodb，免费使用vercel搭建后端接口服务，无需服务器\u003c/p\u003e\n\n\u003c/div\u003e\n\n## 🌈 特点\n\n- 🚀 快速部署，无需服务器 [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A//github.com/hugh888888/VercelKoa2Template\u0026env=redis_url\u0026env=mongodbUrl)\n- ✈️ 支持连接 redis 和 mongodb\n- ✨ 支持配置自定义域名\n\n## 👋 部署教程\n\n### 准备工作\n\n- 域名（可选） 国内推荐使用自定义域名，可托管 CLoudflare，国外使用 vercel 自带域名即可\n- [mongodb（可选）](https://www.mongodb.com) mongodb 数据库\n- [redis（可选）](https://upstash.com/) redis 数据库\n- [Vercel](https://vercel.com)注册 Vercel 账号，用于部署 Koa2 服务\n- vercel mongodb redis 可使用 github 账号注册登录，使用个人免费计划\n  ![mongodb 配置](./img/mongodb.png)\n- ![redis配置](./img/redis.png)\n- ![域名配置](./img/vercel.png)\n\n### 部署\n\n**环境变量:**\n\n| 变量名     | 说明               | 示例                                                                                           |\n| ---------- | ------------------ | ---------------------------------------------------------------------------------------------- |\n| redis_url  | redis 数据库 Url   | `redis://default:xxxxx@xxxxxxxx.upstash.io:34903`                                              |\n| mongodbUrl | mongodb 数据库 url | `mongodb+srv://\u003cusername\u003e:\u003cpwd\u003e@xxxx.ulopy3w.mongodb.net/\u003cdbname\u003e?retryWrites=true\u0026w=majority` |\n\n**Vercel:**\n\n推荐使用一键部署按钮（此操作会在你的 github 账户中自动创建仓库并关联部署到 vercel）：\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A//github.com/hugh888888/VercelKoa2Template\u0026env=redis_url\u0026env=mongodbUrl)\n\n## 🔨 本地运行调试\n\n- 1、vercel 上部署本项目，填写环境变量。\n- 2、拉取代码到本地，执行以下命令\n\n```bash\n# 安装 vercel cli\npnpm i -g vercel\n# 获取环境变量\nvercel pull --environment=development\n# 进入项目目录，安装依赖\npnpm install\n# 使用vercel dev启动项目\nvercel dev\n```\n\n## 🪡 接口 demo\n\n- [getRedisData](https://template.li-h.me/getRedisData) https://template.li-h.me/getRedisData\n- [addUser](https://template.li-h.me/addUser?name=1\u0026phone=2) https://template.li-h.me/addUser\n- [getList](https://template.li-h.me/getList) https://template.li-h.me/getList\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=hugh888888/VercelKoa2Template\u0026type=Date)](https://star-history.com/#hugh888888/VercelKoa2Template\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugh888888%2Fvercelkoa2template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugh888888%2Fvercelkoa2template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugh888888%2Fvercelkoa2template/lists"}