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.
19 lines
423 B
19 lines
423 B
4 years ago
|
const {InfluxDB} = require('@influxdata/influxdb-client')
|
||
|
const chalk = require('chalk')
|
||
|
|
||
|
const {url, token, org, bucket} = require('../config/dev')
|
||
|
|
||
|
const client = new InfluxDB({
|
||
|
url: url,
|
||
|
token: token,
|
||
|
});
|
||
|
|
||
|
const writeApi = client.getWriteApi(
|
||
|
org,
|
||
|
bucket
|
||
|
);
|
||
|
|
||
|
const queryApi = client.getQueryApi(org);
|
||
|
console.log(chalk.yellow('Initialized Database connection...'));
|
||
|
|
||
|
module.exports = {writeApi, queryApi}
|