10 lines
199 B
TypeScript
10 lines
199 B
TypeScript
export function buildApiUrl(path: string): string {
|
|
const base = process.env.NEXT_PUBLIC_API_BASE_URL?.trim();
|
|
|
|
if (!base) {
|
|
return path;
|
|
}
|
|
|
|
return `${base.replace(/\/$/, "")}${path}`;
|
|
}
|