Admin UI initial #47

Merged
amigan merged 12 commits from adminui into trunk 2024-11-22 17:07:14 -05:00
4 changed files with 15 additions and 8 deletions
Showing only changes of commit e3b48a6f65 - Show all commits

View file

@ -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"

View file

@ -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);
} }

View file

@ -0,0 +1,3 @@
export const environment = {
baseUrl: 'http://xenon:3050',
};

View file

@ -0,0 +1,3 @@
export const environment = {
baseUrl: '',
};