diff --git a/src/app/services/tournament.service.ts b/src/app/services/tournament.service.ts index 289a27d..3803fbb 100644 --- a/src/app/services/tournament.service.ts +++ b/src/app/services/tournament.service.ts @@ -2,6 +2,7 @@ import { Injectable, inject } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable } from 'rxjs'; import { Tournament, TournamentList, RoundPairings } from '../models/tournament.models'; +import { environment } from '../../environments/environment'; export interface CreateTournamentForm { name: string; @@ -14,7 +15,7 @@ export interface CreateTournamentForm { @Injectable({ providedIn: 'root' }) export class TournamentService { private readonly http = inject(HttpClient); - private readonly base = '/api/tournament'; + private readonly base = `${(environment.tournamentServerUrl ?? '').replace(/\/+$/, '')}/api/tournament`; list(): Observable { return this.http.get(this.base);