import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class ApiService { host = 'http://localhost:8000/' constructor(private http: HttpClient) { } getEmployees() { let endpoint = 'employees'; let url = this.host + endpoint; return this.http.get(url); } }