add environments and configuration.service.ts for admin
This commit is contained in:
parent
d5644b6044
commit
8ccb75ee4e
@ -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"
|
||||||
|
|||||||
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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user