egg-influx
基于 node-influx 封装的influx的egg插件,用于操作InfluxDB数据库。
安装
$ npm i egg-influx --save
配置
// {app_root}/config/plugin.jsexportsinflux = enable: true package: 'egg-influx'; // {app_root}/config/config.{env}.jsconfiginflux = host: '127.0.0.1' port: 8086 database: '<database name>' username: '<username>' password: '<password>'
使用方法
const Service = Service; async { const influx Influx = thisapp; try const data = await influx; return data; catch e ctx; } moduleexports = SystemService;
更多用法,参考 node-influx的文档