Skip to content

Commit 82a6f64

Browse files
authored
Rename baseUrl to proxy url for clarity (#498)
1 parent faa147f commit 82a6f64

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/datasource-http/src/DataSource.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import { DataSourceResponse, defaultQuery, MyDataSourceOptions, MyQuery } from '
1313
import { lastValueFrom } from 'rxjs';
1414

1515
export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
16-
baseUrl: string;
16+
proxyUrl: string;
1717

1818
constructor(instanceSettings: DataSourceInstanceSettings<MyDataSourceOptions>) {
1919
super(instanceSettings);
2020

21-
this.baseUrl = instanceSettings.url!;
21+
this.proxyUrl = instanceSettings.url!;
2222
}
2323

2424
getDefaultQuery(_: CoreApp): Partial<MyQuery> {
@@ -36,7 +36,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
3636

3737
// Return a constant for each query.
3838
const data = options.targets.map((target) => {
39-
const df: DataFrame = createDataFrame({
39+
const df: DataFrame = createDataFrame({
4040
refId: target.refId,
4141
fields: [
4242
{ name: 'Time', values: [from, to], type: FieldType.time, config: {} },
@@ -51,7 +51,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
5151

5252
async request(url: string, params?: string) {
5353
const response = getBackendSrv().fetch<DataSourceResponse>({
54-
url: `${this.baseUrl}${url}${params?.length ? `?${params}` : ''}`,
54+
url: `${this.proxyUrl}${url}${params?.length ? `?${params}` : ''}`,
5555
});
5656
return lastValueFrom(response);
5757
}

0 commit comments

Comments
 (0)