Refactor API URLs to use GlobalConstants and update CORS configurations for production
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user