import { Injectable, inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ApiConfigService } from '../core/config/api-config.service';

@Injectable({ providedIn: 'root' })
export class ApiHealthService {
  private readonly http = inject(HttpClient);
  private readonly apiConfig = inject(ApiConfigService);

  ping(): Observable<{ message: string }> {
    return this.http.get<{ message: string }>(`${this.apiConfig.getBaseUrl()}/ping`);
  }
}