create-worker-app
快速创建 Cloudflare Workers 应用的脚手架工具,基于 Hono.js 框架。
使用方法
npx create-worker-app my-app
npm install -g create-worker-app
create-worker-app my-app
npm init worker-app my-app
特性
- 🚀 基于 Hono.js - 超快的 Web 框架
- 📝 TypeScript 支持
- 📚 可选的 OpenAPI/Swagger 文档生成
- 🗄️ 可选的数据库配置
- 🛠️ 内置路由生成器
- ⚡ Cloudflare Workers 优化
创建的项目结构
my-app/
├── src/
│ ├── index.ts # 应用入口
│ ├── types/ # 类型定义
│ ├── routes/ # API 路由
│ ├── schemas/ # Zod schemas
│ └── lib/ # 工具库
├── scripts/
│ └── generate-route.js # 路由生成器
├── wrangler.toml # Cloudflare 配置
├── tsconfig.json # TypeScript 配置
├── package.json
└── README.md
开发
git clone https://github.com/leeguooooo/create-worker-app.git
cd create-worker-app
npm install
node index.js test-app
License
MIT