import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from '../../environments/environment'; @Injectable({ providedIn: 'root', }) export class RegisterService { private apiUrl = environment.apiURL; constructor(private http: HttpClient) {} register(username: string, password: string): Observable { return this.http.post(this.apiUrl + '/register', { username, password }); } }