js for fetch spring cloud config files
npm install spring-cloud-config-client-jsjs for fetch or save a spring cloud clients config
> yarn add spring-cloud-confg-client-js
or
> npm install spring-cloud-confg-client-js
`
import SpringCloudConfigClient from 'spring-cloud-config-client-js'
//initial
const springCloudConfigClient = new SpringCloudConfigClient({
configServerUrl: "[config-server-url]"
// if you use server with spring security, set auth info
// is optional
auth: {
username: "username",
password: "password"
}
})
springCloudConfigClient.fetch({
name: '[your-application]',
//profile is optional
profile: '[your-profile]'
}).then(console.log).catch(console.error)
//write file with absolute path
//save and will return config too
springCloudConfigClient.write(__dirname + '/config.json', {
name: '[your-application]',
//profile is optional
profile: '[your-profile]'
}).then(console.log).catch(console.error)
``
#### About Typescript
this project supply typescript