Refactor API URLs to use GlobalConstants and update CORS configurations for production

This commit is contained in:
liosha84
2025-07-28 13:15:44 +03:00
parent 88f0cf307e
commit c58dd4ac5c
45 changed files with 587 additions and 72 deletions
@@ -1,8 +1,9 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import {GlobalConstants} from '../global-constants';
const AUTH_API = 'http://localhost:8080/api/auth/';
const AUTH_API = GlobalConstants.API_URL + '/auth/';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
@@ -15,6 +16,7 @@ export class AuthService {
constructor(private http: HttpClient) { }
login(username: string, password: string): Observable<any> {
console.log(AUTH_API + 'signin');
return this.http.post(AUTH_API + 'signin', {
username,
password