提交 5b73ba50 编写于 作者: Q Quinton.Xu

update README.md

上级 ab204945
......@@ -30,6 +30,30 @@ Node.js >= 6.0.0 required.
## Methods
### apollo# ```remoteConfigServiceFromCache(config)```
```
const config = {
configServerUrl: 'http://example.com',
appId: '<appId>',
clusterName: 'default',
namespaceName: [ 'namespaceName1', 'namespaceName1' ],
// clientIp: '',
};
const result = await apollo.remoteConfigServiceFromCache(config);
```
>**NOTE:** 通过带缓存的Http接口从Apollo读取配置,详情请参考[Apollo开放平台](https://github.com/ctripcorp/apollo/wiki/%E5%85%B6%E5%AE%83%E8%AF%AD%E8%A8%80%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97#12-%E9%80%9A%E8%BF%87%E5%B8%A6%E7%BC%93%E5%AD%98%E7%9A%84http%E6%8E%A5%E5%8F%A3%E4%BB%8Eapollo%E8%AF%BB%E5%8F%96%E9%85%8D%E7%BD%AE).
### apollo# ```remoteConfigServiceSikpCache(config)```
```
const config = {
configServerUrl: 'http://example.com',
appId: '<appId>',
clusterName: 'default',
namespaceName: [ 'namespaceName1', 'namespaceName1' ],
// clientIp: '',
};
const result = await apollo.remoteConfigServiceSikpCache(config);
```
>**NOTE:** 通过不带缓存的Http接口从Apollo读取配置,详情请参考[Apollo开放平台]https://github.com/ctripcorp/apollo/wiki/%E5%85%B6%E5%AE%83%E8%AF%AD%E8%A8%80%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97#13-%E9%80%9A%E8%BF%87%E4%B8%8D%E5%B8%A6%E7%BC%93%E5%AD%98%E7%9A%84http%E6%8E%A5%E5%8F%A3%E4%BB%8Eapollo%E8%AF%BB%E5%8F%96%E9%85%8D%E7%BD%AE.
### apollo# ```remoteConfigService(config)```
```
const config = {
......@@ -43,7 +67,7 @@ Node.js >= 6.0.0 required.
};
const result = await apollo.remoteConfigService(config);
```
>**NOTE:** 读取携程Apollo配置,调用第三方应用接入Apollo开放平台, 详情请参考[Apollo开放平台](https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0).
>**NOTE:** 通过不带缓存的Http接口从Apollo读取配置, 详情请参考[Apollo开放平台](https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0).
### apollo# ```createEnvFile(envConfig)```
```
const envConfig = {
......
......@@ -20,7 +20,7 @@ describe('#index', function () {
assert(Object.keys(result).length > 0, 'Read config failed');
});
// 通过带缓存的Http接口从Apollo读取配置
it('index.remoteConfigServiceSikpCache', async () => {
it('index.remoteConfigServiceFromCache', async () => {
const eggConfig = {
configServerUrl: 'http://example.com',
appId: '<appId>',
......@@ -28,7 +28,7 @@ describe('#index', function () {
namespaceName: [ 'namespaceName1', 'namespaceName1' ],
// clientIp: '',
};
const result = await apollo.remoteConfigServiceSikpCache(eggConfig);
const result = await apollo.remoteConfigServiceFromCache(eggConfig);
console.log(result)
assert(Object.keys(result).length > 0, 'Read config failed');
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册