lvgithub / ctrip-apollo-client Goto Github PK
View Code? Open in Web Editor NEWThis is a client library for Apollo(A reliable configuration management system) written in Node.js.
License: Other
This is a client library for Apollo(A reliable configuration management system) written in Node.js.
License: Other
apollo-client: pollingNotification error: Request failed with status code 304
304应该是使用缓存,但是却报了个error
我已经基于你的1.0.3的tag, 支持了通过AccessKey访问Apollo,能PR给你吗?
我想在Angular 10 中使用这个客户端读取apollo 配置中心的配置信息。
在npm run build 时 出现以下异常:
ERROR in ./node_modules/@lvgithub/ctrip-apollo-client/src/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/robin/Regtics/regtics-web/node_modules/@lvgithub/ctrip-apollo-client/src'
ERROR in ./node_modules/@lvgithub/ctrip-apollo-client/src/index.js
Module not found: Error: Can't resolve 'path' in '/Users/robin/Regtics/regtics-web/node_modules/@lvgithub/ctrip-apollo-client/src'
config :>> {
application: {
appId: 'xxx',
cluster: 'default',
namespaceName: 'application',
configurations: {
NODE_ENV: 'development',
HCAPTCHA_BASE_URL: 'https://hcaptcha.com',
},
releaseKey: 'xxx'
}
}
configApollo :>> {
NODE_ENV: 'development',
HCAPTCHA_BASE_URL: 'https://hcaptcha.com',
}
这个是配置,我取 hotValue('HCAPTCHA_BASE_URL:123') namespace 默认 application,然后取不到这个值,返回的是123说明走了 defaultValue 逻辑
请问有什么方法可以中断连接吗
现在版本依赖的axios版本有点低
下下来的包代码是旧的!
async polling () {
let pollingCount = 1
while (true) {
this.info('polling count:', pollingCount++)
try {
await this.pollingNotification()
await sleep(2000) // 这里不加会阻塞事件循环 长链接进不来 this.pollingNotification()加的已经被catch掉了
} catch (error) {
this.error('polling error:', error)
await sleep(1000)
}
}
}
之前项目里的配置都存放在config.js文件里,其他地方使用都是直接import的,如果可以实现同步获取apollo配置的话,可以完美替换这种场景。
tslint error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
CtripApplloClient -> CtripApolloClient
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.