Use HF backend URL for sign-up/sign-in
Browse files
src/app/homepage/sign-in/sign-in.service.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
| 1 |
import { Injectable } from '@angular/core';
|
| 2 |
import { HttpClient } from '@angular/common/http';
|
| 3 |
import { Observable } from 'rxjs';
|
|
|
|
| 4 |
|
| 5 |
@Injectable({
|
| 6 |
providedIn: 'root'
|
| 7 |
})
|
| 8 |
export class SignInService {
|
| 9 |
|
|
|
|
|
|
|
| 10 |
constructor(private http: HttpClient) { }
|
| 11 |
|
| 12 |
signIn(payload: any): Observable<any> {
|
| 13 |
-
return this.http.post(
|
| 14 |
}
|
| 15 |
}
|
|
|
|
| 1 |
import { Injectable } from '@angular/core';
|
| 2 |
import { HttpClient } from '@angular/common/http';
|
| 3 |
import { Observable } from 'rxjs';
|
| 4 |
+
import { environment } from 'src/environments/environment'; // adjust path if needed
|
| 5 |
|
| 6 |
@Injectable({
|
| 7 |
providedIn: 'root'
|
| 8 |
})
|
| 9 |
export class SignInService {
|
| 10 |
|
| 11 |
+
private apiUrl = environment.pyDetectApiUrl;
|
| 12 |
+
|
| 13 |
constructor(private http: HttpClient) { }
|
| 14 |
|
| 15 |
signIn(payload: any): Observable<any> {
|
| 16 |
+
return this.http.post(`${this.apiUrl}/sign-in`, payload);
|
| 17 |
}
|
| 18 |
}
|
src/app/homepage/sign-up/sign-up.service.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
| 1 |
import { Injectable } from '@angular/core';
|
| 2 |
-
import { HttpClient } from '@angular/common/http';
|
| 3 |
-
import { Observable } from 'rxjs';
|
|
|
|
| 4 |
|
| 5 |
@Injectable({
|
| 6 |
providedIn: 'root'
|
| 7 |
})
|
| 8 |
export class SignUpService {
|
| 9 |
-
private apiUrl =
|
|
|
|
| 10 |
constructor(private http: HttpClient) { }
|
| 11 |
|
| 12 |
-
// Method to sign up a user
|
| 13 |
signUp(payload: any): Observable<any> {
|
| 14 |
return this.http.post(`${this.apiUrl}/sign-up`, payload);
|
| 15 |
}
|
|
|
|
| 1 |
import { Injectable } from '@angular/core';
|
| 2 |
+
import { HttpClient } from '@angular/common/http';
|
| 3 |
+
import { Observable } from 'rxjs';
|
| 4 |
+
import { environment } from 'src/environments/environment'; // adjust path if needed
|
| 5 |
|
| 6 |
@Injectable({
|
| 7 |
providedIn: 'root'
|
| 8 |
})
|
| 9 |
export class SignUpService {
|
| 10 |
+
private apiUrl = environment.pyDetectApiUrl;
|
| 11 |
+
|
| 12 |
constructor(private http: HttpClient) { }
|
| 13 |
|
|
|
|
| 14 |
signUp(payload: any): Observable<any> {
|
| 15 |
return this.http.post(`${this.apiUrl}/sign-up`, payload);
|
| 16 |
}
|
src/environments/environment.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
export const environment = {
|
| 2 |
-
production:
|
| 3 |
-
pyDetectApiUrl: '
|
| 4 |
};
|
|
|
|
| 1 |
export const environment = {
|
| 2 |
+
production: true,
|
| 3 |
+
pyDetectApiUrl: 'https://pykara-Py-detect-backend.hf.space'
|
| 4 |
};
|