Revert to external API url.

This commit is contained in:
Mike Cao committed 2026-06-04 17:32:25 -07:00
1 parent 9ced9ac85a
commit 7de662a71e
3 files changed
+28 -24

No files matched your search

+6 -2
View File
@@ -39,8 +39,12 @@ export function getApiUrl(url: string, options: ApiUrlOptions = {}) {
}
const { apiUrl = process.env.apiUrl || '', basePath = process.env.basePath || '' } = options;
const useApiUrl = apiUrl && !isAbsoluteUrl(apiUrl) && !isAppRoute(url);
const baseUrl = useApiUrl ? joinPath(basePath, apiUrl) : joinPath(basePath, '/api');
const useApiUrl = apiUrl && !isAppRoute(url);
const baseUrl = useApiUrl
? isAbsoluteUrl(apiUrl)
? apiUrl
: joinPath(basePath, apiUrl)
: joinPath(basePath, '/api');
return joinPath(baseUrl, url);
}