Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
380 B
TypeScript
Raw Normal View History

const apiBaseUrl = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8080';
2025-07-01 14:22:19 +01:00
export const makeApiUrl = (endpoint: string): string => {
const baseUrl = apiBaseUrl;
2025-07-01 14:22:19 +01:00
// If baseUrl is empty (development), return endpoint as-is for proxy
if (!baseUrl) {
return endpoint;
}
// For production, combine base URL with endpoint
return `${baseUrl}${endpoint}`;
};