add environments and configuration.service.ts for admin
This commit is contained in:
13
admin/src/app/services/configuration.service.ts
Normal file
13
admin/src/app/services/configuration.service.ts
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
16
admin/src/app/services/configuration.spec.ts
Normal file
16
admin/src/app/services/configuration.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
5
admin/src/environments/environment.development.ts
Normal file
5
admin/src/environments/environment.development.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AppConfig } from '../types';
|
||||
|
||||
export const environment: AppConfig = {
|
||||
apiUrl: 'http://localhost:4200/api'
|
||||
};
|
||||
5
admin/src/environments/environment.production.ts
Normal file
5
admin/src/environments/environment.production.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AppConfig } from '../types';
|
||||
|
||||
export const environment: AppConfig = {
|
||||
apiUrl: 'http://localhost:4200/api'
|
||||
};
|
||||
5
admin/src/environments/environment.ts
Normal file
5
admin/src/environments/environment.ts
Normal 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
4
admin/src/types.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
export interface AppConfig{
|
||||
apiUrl: string;
|
||||
}
|
||||
Reference in New Issue
Block a user