datasurvey/src/main/webapp/app/core/config/application-config.service.ts

20 lines
467 B
TypeScript

import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class ApplicationConfigService {
private endpointPrefix = '';
setEndpointPrefix(endpointPrefix: string): void {
this.endpointPrefix = endpointPrefix;
}
getEndpointFor(api: string, microservice?: string): string {
if (microservice) {
return `${this.endpointPrefix}services/${microservice}/${api}`;
}
return `${this.endpointPrefix}${api}`;
}
}