egg-datasource
v1.1.7
Published
A simple datasource proxy for egg
Downloads
10
Readme
egg-datasource
Install
$ npm i egg-datasource --save
Usage
// {app_root}/config/plugin.js
exports.datasource = {
enable: true,
package: 'egg-datasource',
};
Configuration
// {app_root}/config/config.default.js
exports.datasource = {
projectName: {
mocking: false, // 是否开启mock模式
mockUrl: 'https://test.com', // mock url
protocol: 'http', // 正式使用的协议
host: 'data.com',
port: '8080',
path: '',
onStart(ctx) { // 代理请求前钩子
// ...
},
onEnd(ctx) { // 代理请求后钩子
// ...
}
}
};
see config/config.default.js for more detail.
Example
Questions & Suggestions
Please open an issue here.