@fastcar/template-rpc
v1.0.0
Published
基于 fastcar-core的rpc项目模板
Maintainers
Readme
@fastcar/template-rpc
基于 fastcar-core 的 RPC 服务器模板
简介
这是一个用于快速搭建 RPC 服务器的模板,适用于构建微服务通信场景。
特性
- 🚀 基于 fastcar-core 框架
- 🔗 内置 RPC 通信支持
- 📦 支持 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。
项目结构
template/
├── src/
│ ├── controller/ # RPC 控制器
│ │ ├── AuthController.ts
│ │ ├── EntryController.ts
│ │ └── HelloController.ts
│ └── app.ts # 应用入口
├── resource/
│ └── application.yml # 配置文件
├── test/ # 测试文件
├── target/ # 编译输出
├── package.json
├── tsconfig.json
└── ecosystem.config.yml依赖
- @fastcar/core - 核心框架
- @fastcar/rpc - RPC 支持
- @fastcar/server - 服务器支持
相关模板
- @fastcar/template-web - Web 项目模板
- @fastcar/template-static - 静态资源服务器模板
- @fastcar/template-cos - 对象存储服务模板
- @fastcar/template-microservices - 微服务应用模板
License
MIT
