Refactor API URLs to use GlobalConstants and update CORS configurations for production
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import {environment} from '../environments/environment';
|
||||
|
||||
export class GlobalConstants {
|
||||
|
||||
public static readonly API_URL = (() => {
|
||||
// ... calculate the value and return it
|
||||
|
||||
if(environment.production) {
|
||||
return `${environment.host_name}/api`;
|
||||
}else {
|
||||
return `${environment.host_name}:${environment.port}/api`;
|
||||
}
|
||||
|
||||
})();
|
||||
}
|
||||
Reference in New Issue
Block a user