0.0.4 • Published 3 years ago

fe-config-center-agent v0.0.4

Weekly downloads
1
License
UNLICENSED
Repository
-
Last release
3 years ago

前端配置中心(客户端)

前端配置中心客户端,通过客户端获取配置

安装

npm install fe-config-center-agent --save

注意

过程中会全局安装forever,如果失败请手动安装

npm install forever -g

使用

const ConfigCenter = require('fe-config-center-agent')
const configs = new ConfigCenter()

// 获取key的值 
Config.get({
    key:'redis',
    departGroup:'平台-前端',
}).then(res=>{
    console.log(res)
})

// 创建key value
Config.create({
    key:'redis',
    departGroup:'平台-前端',
    value:'http://localhost:1234'
})

// 更新key value
Config.update({
    key:'redis',
    departGroup:'平台-前端',
    value:'http://localhost:1234'
})

// 删除key value
Config.delete({
    key:'redis',
    departGroup:'平台-前端',
})