diff --git a/server/config/keys.js b/server/config/keys.js index 1937595..3b3e338 100644 --- a/server/config/keys.js +++ b/server/config/keys.js @@ -1,8 +1,7 @@ module.exports = { - influx_uri: 'http://influx:8086', - influx_token: '', - influx_org: '', - influx_bucket: '', + influx_url: 'http://influx:8086', + influx_org: 'xrazis', + influx_bucket: 'db0', redis_user: '', redis_password: '', redis_uri: 'redis://redis:6379', diff --git a/server/connections/influx_conn.js b/server/connections/influx_conn.js index 868ccf3..33ef718 100644 --- a/server/connections/influx_conn.js +++ b/server/connections/influx_conn.js @@ -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} \ No newline at end of file +module.exports = {writeApi, queryApi} \ No newline at end of file