Skip to content

Commit fa34c05

Browse files
authored
fix: relative path when on gha (#118)
1 parent 1a2b1c3 commit fa34c05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

report/src/services/dataService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export class DataService {
1111
private baseUrl: string;
1212

1313
constructor(baseUrl: string) {
14-
this.baseUrl = baseUrl.replace(/\/$/, ""); // Remove trailing slash
14+
this.baseUrl = baseUrl.replace(/\/$/, "") + "/"; // Ensure trailing slash
1515
}
1616

1717
async getMetadata(): Promise<BenchmarkRuns> {
18-
const response = await fetch(`${this.baseUrl}/output/metadata.json`);
18+
const response = await fetch(`${this.baseUrl}output/metadata.json`);
1919

2020
if (!response.ok) {
2121
throw new Error(
@@ -27,7 +27,7 @@ export class DataService {
2727
}
2828

2929
async getMetrics(outputDir: string, nodeType: string): Promise<MetricData[]> {
30-
const metricsPath = `${this.baseUrl}/output/${outputDir}/metrics-${nodeType}.json`;
30+
const metricsPath = `${this.baseUrl}output/${outputDir}/metrics-${nodeType}.json`;
3131
const response = await fetch(metricsPath);
3232

3333
if (!response.ok) {
@@ -72,7 +72,7 @@ export function getDataSourceConfig(): DataServiceConfig {
7272
const dataSource = getEnvVar("DATA_SOURCE") || "static";
7373

7474
if (dataSource === "api" && apiBaseUrl) {
75-
// API mode: use the configured API base URL
75+
// API mode: use the configured API base URL (ensure trailing slash)
7676
return { baseUrl: apiBaseUrl };
7777
} else {
7878
// Static mode: use current origin (empty string means relative to current domain)

0 commit comments

Comments
 (0)