Add shows api service

This commit is contained in:
Toast 2025-01-28 11:05:33 +01:00
parent edbd84845a
commit 5cf778e390
4 changed files with 61 additions and 4 deletions

View file

@ -0,0 +1,22 @@
import {inject, Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {ShowsApiResponse} from './shows-api';
@Injectable({
providedIn: 'root'
})
export class ShowsApiService {
private readonly url: string = "https://shows.everest.tailscale/api/";
private showsEndpoint: string
private http: HttpClient = inject(HttpClient);
constructor() {
this.showsEndpoint = this.url + "shows/"
}
getShows(): Observable<ShowsApiResponse> {
return this.http.get<ShowsApiResponse>(this.showsEndpoint)
}
}