refactor: use constant for api url

This commit is contained in:
Phan Huy Tran 2025-05-21 11:04:54 +02:00 committed by Phan Huy Tran
commit c6d886b68b
2 changed files with 18 additions and 1 deletions

View file

@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { DiceDto, DiceResult } from './dice.model';
import {environment} from "@environments/environment";
@Injectable({
providedIn: 'root',
})
export class DiceService {
private apiUrl = '/backend/dice';
private apiUrl = `${environment.apiUrl}/dice`;
constructor(private http: HttpClient) {}