Admin UI initial #47
4 changed files with 15 additions and 8 deletions
|
@ -46,7 +46,13 @@
|
||||||
"development": {
|
"development": {
|
||||||
"optimization": false,
|
"optimization": false,
|
||||||
"extractLicenses": false,
|
"extractLicenses": false,
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.development.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "production"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { environment } from './../environments/environment';
|
||||||
import {
|
import {
|
||||||
HttpRequest,
|
HttpRequest,
|
||||||
HttpHandlerFn,
|
HttpHandlerFn,
|
||||||
|
@ -12,17 +13,11 @@ import { AuthService } from './login/auth.service';
|
||||||
|
|
||||||
import { routes } from './app.routes';
|
import { routes } from './app.routes';
|
||||||
import { provideHttpClient } from '@angular/common/http';
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
export function apiBaseInterceptor(
|
export function apiBaseInterceptor(
|
||||||
req: HttpRequest<unknown>,
|
req: HttpRequest<unknown>,
|
||||||
next: HttpHandlerFn,
|
next: HttpHandlerFn,
|
||||||
): Observable<HttpEvent<unknown>> {
|
): Observable<HttpEvent<unknown>> {
|
||||||
let baseUrl: string;
|
let baseUrl = environment.baseUrl;
|
||||||
if (isDevMode()) {
|
|
||||||
baseUrl = 'http://xenon:3050';
|
|
||||||
} else {
|
|
||||||
baseUrl = '';
|
|
||||||
}
|
|
||||||
const apiReq = req.clone({ url: `${baseUrl}${req.url}` });
|
const apiReq = req.clone({ url: `${baseUrl}${req.url}` });
|
||||||
return next(apiReq);
|
return next(apiReq);
|
||||||
}
|
}
|
||||||
|
|
3
client/admin/src/environments/environment.development.ts
Normal file
3
client/admin/src/environments/environment.development.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export const environment = {
|
||||||
|
baseUrl: 'http://xenon:3050',
|
||||||
|
};
|
3
client/admin/src/environments/environment.ts
Normal file
3
client/admin/src/environments/environment.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export const environment = {
|
||||||
|
baseUrl: '',
|
||||||
|
};
|
Loading…
Reference in a new issue