You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
438 B
16 lines
438 B
const {InfluxDB} = require('@influxdata/influxdb-client')
|
|
const chalk = require('chalk')
|
|
|
|
const {influx_url, influx_org, influx_bucket} = require('../config/keys')
|
|
|
|
const client = new InfluxDB({
|
|
url: influx_url
|
|
});
|
|
|
|
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 = {writeApi, queryApi}
|