import { Injectable, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { environment } from '../../../../environments/environment';

@Injectable({
    providedIn: 'root'
})
export class apiAuthService {
    ServeurURL = environment.ServeurURL;
    ApiURL = this.ServeurURL+"/api";


    constructor(private http: HttpClient){}    

    // authenticate
    authenticate(email: string, password: string) {
        return this.http.post<{token: string}>(this.ServeurURL+'/authenticate', {email, password});
    }
}