You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

status.service.ts 664B

123456789101112131415161718192021
  1. import {HttpClient, HttpHeaders} from '@angular/common/http';
  2. import {Injectable} from '@angular/core';
  3. import {Observable} from 'rxjs';
  4. import {SiteModel} from '../models/site.model';
  5. import {ApiResultModel} from '../models/api-result.model';
  6. const httpPostOptions = {
  7. headers: new HttpHeaders({ 'Content-Type': 'application/json' })
  8. };
  9. @Injectable({ providedIn: 'root' })
  10. export class StatusService {
  11. private urlBase = 'api/status';
  12. constructor(
  13. private http: HttpClient) { }
  14. getHosts(): Observable<ApiResultModel<SiteModel[]>> {
  15. return this.http.get<ApiResultModel<SiteModel[]>>(`${this.urlBase}/hosts`);
  16. }
  17. }