d1e38fba32
Co-authored-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Michael Neale <michael.neale@gmail.com>
10 lines
355 B
TypeScript
10 lines
355 B
TypeScript
// Helper to construct API endpoints
|
|
export const getApiUrl = (endpoint: string): string => {
|
|
const baseUrl =
|
|
String(window.appConfig.get('GOOSE_API_HOST') || '') +
|
|
':' +
|
|
String(window.appConfig.get('GOOSE_PORT') || '');
|
|
const cleanEndpoint = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
|
|
return `${baseUrl}${cleanEndpoint}`;
|
|
};
|