Set up environment-based configurations for API and builds.
Replaced hardcoded API URLs with environment-specific configurations. Added new environments (development, beta, production) with respective settings. Updated build scripts and Angular file replacements to support environment-based builds.
This commit is contained in:
@@ -5,6 +5,7 @@ import {NgForOf, NgIf, NgOptimizedImage} from '@angular/common';
|
||||
import {CookieService} from 'ngx-cookie-service';
|
||||
import {RemoveTrailingPeriodPipe} from '../../util/RemoveTrailingPeriodPipe';
|
||||
import {HttpErrorResponse} from '@angular/common/http';
|
||||
import {environment} from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-history',
|
||||
@@ -18,7 +19,7 @@ import {HttpErrorResponse} from '@angular/common/http';
|
||||
styleUrl: './history.component.scss',
|
||||
providers: [
|
||||
CookieService,
|
||||
{provide: BASE_PATH, useValue: 'http://localhost:8080/'}
|
||||
{provide: BASE_PATH, useValue: environment.apiUrl}
|
||||
],
|
||||
})
|
||||
export class HistoryComponent implements OnInit, OnChanges {
|
||||
|
||||
@@ -5,6 +5,7 @@ import {CommonModule, NgOptimizedImage} from '@angular/common';
|
||||
import {HeaderComponent} from '../header/header.component';
|
||||
import {CookieService} from 'ngx-cookie-service';
|
||||
import {map, Observable, shareReplay} from 'rxjs';
|
||||
import {environment} from '../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-team',
|
||||
@@ -16,7 +17,7 @@ import {map, Observable, shareReplay} from 'rxjs';
|
||||
],
|
||||
providers: [
|
||||
CookieService,
|
||||
{provide: BASE_PATH, useValue: 'http://localhost:8080/'}
|
||||
{provide: BASE_PATH, useValue: environment.apiUrl}
|
||||
],
|
||||
|
||||
templateUrl: './team.component.html',
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
apiUrl: 'https://beta.alttd.com'
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://localhost:8080'
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
apiUrl: 'https://alttd.com'
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
apiUrl: 'https://alttd.com'
|
||||
};
|
||||
@@ -4,13 +4,13 @@ import {provideRouter} from '@angular/router';
|
||||
import {routes} from './app/app.routes';
|
||||
import {provideHttpClient} from '@angular/common/http';
|
||||
import {BASE_PATH} from './api';
|
||||
|
||||
import {environment} from './environments/environment';
|
||||
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
provideRouter(routes),
|
||||
provideHttpClient(),
|
||||
{provide: BASE_PATH, useValue: 'http://localhost:8080'}
|
||||
{provide: BASE_PATH, useValue: environment.apiUrl}
|
||||
]
|
||||
}).catch(err => console.error(err));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user