add environments and configuration.service.ts for admin

This commit is contained in:
Roland Schneider 2025-11-19 09:12:27 +01:00
parent d5644b6044
commit 8ccb75ee4e
7 changed files with 62 additions and 2 deletions

View File

@ -39,12 +39,24 @@
"maximumError": "8kB" "maximumError": "8kB"
} }
], ],
"outputHashing": "all" "outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.production.ts"
}
]
}, },
"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

@ -0,0 +1,13 @@
import { Injectable } from '@angular/core';
import { environment } from '../../environments/environment';
@Injectable({
providedIn: 'root',
})
export class ConfigurationService {
public getApiUrl(): string{
return environment.apiUrl;
}
}

View File

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ConfigurationService } from './configuration.service';
describe('Configuration', () => {
let service: ConfigurationService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ConfigurationService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,5 @@
import { AppConfig } from '../types';
export const environment: AppConfig = {
apiUrl: 'http://localhost:4200/api'
};

View File

@ -0,0 +1,5 @@
import { AppConfig } from '../types';
export const environment: AppConfig = {
apiUrl: 'http://localhost:4200/api'
};

View File

@ -0,0 +1,5 @@
import { AppConfig } from '../types';
export const environment: AppConfig = {
apiUrl: 'http://localhost:4200/api'
};

4
admin/src/types.ts Normal file
View File

@ -0,0 +1,4 @@
export interface AppConfig{
apiUrl: string;
}