diff --git a/client/src/app/services/auth.service.ts b/client/src/app/services/auth.service.ts index 4063814..b1274ca 100644 --- a/client/src/app/services/auth.service.ts +++ b/client/src/app/services/auth.service.ts @@ -3,6 +3,7 @@ import {catchError, map, of, switchMap, tap} from 'rxjs'; import {Credentials} from '../interfaces/credentials'; import {HttpClient} from '@angular/common/http'; import {User} from '../interfaces/user'; +import {environment} from '../../environments/environment'; @Injectable({ providedIn: 'root' @@ -10,7 +11,7 @@ import {User} from '../interfaces/user'; export class AuthService { private readonly http = inject(HttpClient); - private readonly BASE_URL = 'http://localhost:3000/api/auth'; + private readonly BASE_URL = `${environment.apiUrl}/auth`; readonly user = signal(null); private readonly accessToken = signal(null); diff --git a/client/src/environments/environment.prod.ts b/client/src/environments/environment.prod.ts new file mode 100644 index 0000000..6e537bb --- /dev/null +++ b/client/src/environments/environment.prod.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + apiUrl: 'https://dev.unifihomenetwork.com/gameovergne-api' +}; diff --git a/client/src/environments/environment.ts b/client/src/environments/environment.ts new file mode 100644 index 0000000..5f5c8ae --- /dev/null +++ b/client/src/environments/environment.ts @@ -0,0 +1,4 @@ +export const environment = { + production: false, + apiUrl: 'http://localhost:3000/api' +};