import { HttpClient } from '@angular/common/http'; import { inject, Service } from '@angular/core'; import { Observable } from 'rxjs'; @Service() export class BaseService { private readonly http: HttpClient = inject(HttpClient); private readonly baseAddress: string = "http://127.0.0.1:8080/"; protected get(url: string): Observable { return this.http.get(this.baseAddress + url); } protected post(url: string, body: T): Observable { return this.http.post(this.baseAddress + url, body); } }