提交 2d6fc6d2 编写于 作者: Q qifeng

Merge branch 'master' of github.com:Quinton/node-apollo

......@@ -17,12 +17,13 @@
```bash
$ npm i node-apollo --save-dev
```
Node.js >= 6.0.0 required.
Node.js >= v7.6.0 required.
## Features
- ✔︎ 适用eggjs([egg-apollojs](https://github.com/yhj2009/egg-apollojs)), thinkjs等docker部署项目
- ✔︎ 适用自己手动搭建的服务,可直接读取JSON格式的配置
- ✔︎ 增加支持http/https协议请求
## Usage
......@@ -33,7 +34,8 @@ Node.js >= 6.0.0 required.
### apollo# ```remoteConfigServiceFromCache(config)```
```javascript
const config = {
configServerUrl: 'http://example.com',
configServerUrl: 'http://example.com',
// configServerUrl: 'https://example.com', // Support https
appId: '<appId>',
clusterName: 'default',
namespaceName: [ 'namespaceName1', 'namespaceName2' ], // n1的配置会被n2配置覆盖
......@@ -45,7 +47,8 @@ Node.js >= 6.0.0 required.
### apollo# ```remoteConfigServiceSkipCache(config)```
```javascript
const config = {
configServerUrl: 'http://example.com',
configServerUrl: 'http://example.com',
// configServerUrl: 'https://example.com', // Support https
appId: '<appId>',
clusterName: 'default',
namespaceName: [ 'namespaceName1', 'namespaceName2' ], // n1的配置会被n2配置覆盖
......@@ -58,7 +61,8 @@ Node.js >= 6.0.0 required.
### apollo# ```remoteConfigService(config)```
```javascript
const config = {
configServerUrl: 'http://example.com',
configServerUrl: 'http://example.com',
// configServerUrl: 'https://example.com', // Support https
appId: '<appId>',
clusterName: 'default',
namespaceName: '', //no surport multi namespace name, optional
......
......@@ -17,7 +17,7 @@ module.exports = {
'Content-Type': 'application/json;charset=UTF-8',
authorization: config.token,
},
rejectUnauthorized: false,
rejectUnauthorized: true,
contentType: 'json',
dataType: 'json',
};
......@@ -34,7 +34,7 @@ module.exports = {
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
rejectUnauthorized: false,
rejectUnauthorized: true,
contentType: 'json',
dataType: 'json',
};
......@@ -54,7 +54,7 @@ module.exports = {
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
rejectUnauthorized: false,
rejectUnauthorized: true,
contentType: 'json',
dataType: 'json',
};
......@@ -75,7 +75,7 @@ module.exports = {
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
rejectUnauthorized: false,
rejectUnauthorized: true,
contentType: 'json',
dataType: 'json',
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册