@fastcar/template-web
v1.0.1
Published
基于 fastcar-core和koa的Web项目模板
Maintainers
Readme
@fastcar/template-web
基于 fastcar-core 和 koa 的 Web 项目模板
简介
这是一个用于快速搭建 Web 服务器的模板,适用于构建 RESTful API 服务。
特性
- 🚀 基于 fastcar-core 框架
- 🔌 集成 Koa 服务器
- 📦 支持 TypeScript
- 🔄 支持 PM2 进程管理
- 📝 内置日志和错误处理
使用方式
安装依赖
cd template
npm install
# 或者
yarn install开发调试
npm run debug
# 或者
yarn debug编译项目
npm run build
# 或者
yarn build启动服务
npm start
# 或者
yarn start停止服务
npm stop
# 或者
yarn stop配置说明
配置文件位于 resource/application.yml:
application:
env: "prod"
settings:
koa:
server:
- { port: 8080, host: "0.0.0.0" }项目结构
template/
├── src/
│ ├── controller/ # 控制器
│ ├── middleware/ # 中间件
│ ├── model/ # 数据模型
│ └── app.ts # 应用入口
├── resource/
│ └── application.yml # 配置文件
├── target/ # 编译输出
├── package.json
├── tsconfig.json
└── ecosystem.config.yml依赖
- @fastcar/core - 核心框架
- @fastcar/koa - Koa 集成
- @fastcar/server - 服务器支持
相关模板
- @fastcar/template-static - 静态资源服务器模板
- @fastcar/template-rpc - RPC 服务器模板
- @fastcar/template-cos - 对象存储服务模板
- @fastcar/template-microservices - 微服务应用模板
License
MIT
