You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 line
661B

  1. import { Injectable } from '@angular/core';
  2. @Injectable({
  3. providedIn: 'root',
  4. })
  5. export class ApplicationConfigService {
  6. private endpointPrefix = '';
  7. private microfrontend = false;
  8. setEndpointPrefix(endpointPrefix: string): void {
  9. this.endpointPrefix = endpointPrefix;
  10. }
  11. setMicrofrontend(microfrontend = true): void {
  12. this.microfrontend = microfrontend;
  13. }
  14. isMicrofrontend(): boolean {
  15. return this.microfrontend;
  16. }
  17. getEndpointFor(api: string, microservice?: string): string {
  18. if (microservice) {
  19. return `${this.endpointPrefix}services/${microservice}/${api}`;
  20. }
  21. return `${this.endpointPrefix}${api}`;
  22. }
  23. }