()
| 141 | |
| 142 | // Derive API URL from backend URL (with backward compat for NEXT_PUBLIC_LEARNHOUSE_API_URL) |
| 143 | const deriveAPIUrl = (): string => { |
| 144 | // Backward compat: if explicit API URL is set, use it |
| 145 | const explicitApiUrl = getConfig('NEXT_PUBLIC_LEARNHOUSE_API_URL') |
| 146 | if (explicitApiUrl) return explicitApiUrl |
| 147 | // Derive from backend URL |
| 148 | const backendUrl = getLEARNHOUSE_BACKEND_URL().replace(/\/+$/, '') |
| 149 | return `${backendUrl}/api/v1/` |
| 150 | } |
| 151 | |
| 152 | // For direct usage, these call the getters |
| 153 | export const getAPIUrl = () => { |
no test coverage detected