Comparing version 5.4.2 to 5.5.0
@@ -218,3 +218,3 @@ export interface IStringable { | ||
* m.name('my_measurement').policy('one_day') // "one_day"."my_measurement" | ||
* m.name('my_measurement').policy('one_day').db('mydb') // "mydb".one_day"."my_measurement" | ||
* m.name('my_measurement').policy('one_day').db('mydb') // "mydb"."one_day"."my_measurement" | ||
*/ | ||
@@ -221,0 +221,0 @@ export declare class Measurement { |
@@ -233,3 +233,3 @@ "use strict"; | ||
* m.name('my_measurement').policy('one_day') // "one_day"."my_measurement" | ||
* m.name('my_measurement').policy('one_day').db('mydb') // "mydb".one_day"."my_measurement" | ||
* m.name('my_measurement').policy('one_day').db('mydb') // "mydb"."one_day"."my_measurement" | ||
*/ | ||
@@ -236,0 +236,0 @@ class Measurement { |
@@ -23,2 +23,7 @@ /// <reference types="node" /> | ||
/** | ||
* Path for Influx within the host, defaults to ''. | ||
* May be used if Influx is behind a reverse proxy or load balancer. | ||
*/ | ||
path?: string; | ||
/** | ||
* Protocol to connect over, defaults to 'http'. | ||
@@ -25,0 +30,0 @@ */ |
@@ -18,2 +18,3 @@ "use strict"; | ||
port: 8086, | ||
path: '', | ||
protocol: 'http' | ||
@@ -231,2 +232,3 @@ }); | ||
port: host.port, | ||
path: host.path, | ||
protocol: host.protocol, | ||
@@ -239,3 +241,3 @@ options: host.options | ||
resolved.hosts.forEach(host => { | ||
this._pool.addHost(`${host.protocol}://${host.host}:${host.port}`, host.options); | ||
this._pool.addHost(`${host.protocol}://${host.host}:${host.port}${host.path}`, host.options); | ||
}); | ||
@@ -242,0 +244,0 @@ this._options.schema.forEach(schema => this._createSchema(schema)); |
@@ -230,8 +230,9 @@ "use strict"; | ||
} | ||
let path = options.path; | ||
const once = doOnce(); | ||
const host = this._getHost(); | ||
let path = host.url.pathname === '/' ? '' : host.url.pathname; | ||
path += options.path; | ||
if (options.query) { | ||
path += '?' + querystring.stringify(options.query); | ||
} | ||
const once = doOnce(); | ||
const host = this._getHost(); | ||
const req = request(Object.assign({ headers: { 'content-length': options.body ? Buffer.from(options.body).length : 0 }, hostname: host.url.hostname, method: options.method, path, port: Number(host.url.port), protocol: host.url.protocol, timeout: this._timeout }, host.options), once((res) => { | ||
@@ -238,0 +239,0 @@ if (res.statusCode >= 500) { |
{ | ||
"name": "influx", | ||
"version": "5.4.2", | ||
"version": "5.5.0", | ||
"description": "InfluxDB Client", | ||
@@ -5,0 +5,0 @@ "main": "./lib/src/index.js", |
142631
4004