Oviya commited on
Commit
d0f7937
·
1 Parent(s): ec5885b

databse connectivity

Browse files
.gitignore CHANGED
@@ -40,3 +40,4 @@ testem.log
40
  # System files
41
  .DS_Store
42
  Thumbs.db
 
 
40
  # System files
41
  .DS_Store
42
  Thumbs.db
43
+ .vs
src/app/auth/sign-up/sign-up.service.ts CHANGED
@@ -20,13 +20,19 @@ export interface SignupResponse {
20
  })
21
  export class SignupService {
22
 
 
 
 
 
 
 
23
  // private apiUrl = 'http://localhost:5000/api/signup'; // Replace with your backend URL
24
  private apiUrl = 'http://localhost:5000/api'; // Replace with your backend URL
25
  //private base = environment.apiBase; // e.g., http://192.168.29.27:5000
26
  constructor(private http: HttpClient) { }
27
 
28
  signup(payload: SignupPayload): Observable<SignupResponse> {
29
- return this.http.post<SignupResponse>(`${this.apiUrl}/signup`, payload).pipe(
30
  catchError(this.handleError)
31
  );
32
  }
 
20
  })
21
  export class SignupService {
22
 
23
+ // Exactly the same style as your other service:
24
+ // hf.space => Hugging Face backend; otherwise => local Flask
25
+ private baseUrl = location.hostname.endsWith('hf.space')
26
+ ? 'https://pykara-py-match-backend.hf.space/api'
27
+ : 'http://localhost:5000/api';
28
+
29
  // private apiUrl = 'http://localhost:5000/api/signup'; // Replace with your backend URL
30
  private apiUrl = 'http://localhost:5000/api'; // Replace with your backend URL
31
  //private base = environment.apiBase; // e.g., http://192.168.29.27:5000
32
  constructor(private http: HttpClient) { }
33
 
34
  signup(payload: SignupPayload): Observable<SignupResponse> {
35
+ return this.http.post<SignupResponse>(`${this.baseUrl}/signup`, payload).pipe(
36
  catchError(this.handleError)
37
  );
38
  }