Skip to content

Commit

Permalink
Avoid need for ENV that points to API URL
Browse files Browse the repository at this point in the history
  • Loading branch information
benpoulson committed Jan 19, 2024
1 parent 5e766bf commit 66dc3d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/Repository/TraceRepositoryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import {Trace} from "../Services/Bprof";
export class TraceRepositoryClient {

static getHostName() {
return process.env.API_HOSTNAME || 'http://localhost:31337';
const currentProtocol = window.location.protocol;
const currentHostname = window.location.hostname;
const newPort = 31337;
return `${currentProtocol}//${currentHostname}:${newPort}`;
}

static async getTraces(
Expand Down

0 comments on commit 66dc3d9

Please sign in to comment.