0.0.4 • Published 4 years ago
egg-uki-base v0.0.4
egg-uki-base
依赖说明
依赖的 egg 版本
egg-uki-base 版本 | egg 1.x |
---|---|
1.x | 😁 |
0.x | ❌ |
依赖的插件
开启插件
// config/plugin.js
exports.ukiBase = {
enable: true,
package: 'egg-uki-base',
};
使用场景
- 提供uki内部egg bff项目所需的所有内容,包含
- 链路追踪、grpc请求方法、http请求方法(ajax httpClient 各提供高度封装和轻度封装方法)、统一错误类型定义、统一鉴权中间件等。可以满足基本的bff项目需求。
详细配置
// config/config.default.js
exports.ukiBase = {
log: true, //链路追踪是否打印详细的日志
};
const path = require('path')
const protoFilePath = path.resolve(__dirname, '../proto')
exports.ukiGrpc = {
clients: {
cmsuser: {
file: protoFilePath + '/cmanage.proto', //proto文件必须放置于app/proto目录下。
clientOptions: {},
endpoint: '192.168.3.3:33008',
timeout: 5000,
},
},
};
请到 config/config.default.js 查看详细配置项说明。
License
0.0.4
4 years ago