Haris Razis
4 years ago
2 changed files with 7 additions and 12 deletions
@ -1,20 +1,16 @@ |
|||
const {InfluxDB} = require('@influxdata/influxdb-client') |
|||
const chalk = require('chalk') |
|||
|
|||
const {influx_uri, influx_token, influx_org, influx_bucket} = require('../config/keys') |
|||
const {influx_url, influx_org, influx_bucket} = require('../config/keys') |
|||
|
|||
const client = new InfluxDB({ |
|||
url: influx_uri, |
|||
token: influx_token, |
|||
url: influx_url |
|||
}); |
|||
|
|||
const write = client.getWriteApi( |
|||
influx_org, |
|||
influx_bucket |
|||
); |
|||
const writeApi = client.getWriteApi(influx_org, influx_bucket, 's'); |
|||
|
|||
const queryApi = client.getQueryApi(influx_org); |
|||
|
|||
console.log(chalk.greenBright.bold('Connected to influx!')) |
|||
|
|||
module.exports = {write, queryApi} |
|||
module.exports = {writeApi, queryApi} |
Loading…
Reference in new issue