const {InfluxDB} = require('@influxdata/influxdb-client') const chalk = require('chalk') const {influx_url, influx_token, influx_org, influx_bucket} = require('../config/keys') const client = new InfluxDB({ url: influx_url, token: influx_token, }); const write = client.getWriteApi( influx_org, influx_bucket ); const queryApi = client.getQueryApi(influx_org); console.log(chalk.greenBright.bold('Connected to influx!')) module.exports = {writeApi: write, queryApi}