MCPcopy
hub / github.com/learnhouse/learnhouse / getAPIUrl

Function getAPIUrl

apps/web/services/config/config.ts:153–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151
152// For direct usage, these call the getters
153export const getAPIUrl = () => {
154 // On custom domains (client-side), use relative path to go through Next.js proxy
155 // This ensures cookies work correctly (same-origin)
156 if (isOnCustomDomain()) {
157 return '/api/v1/'
158 }
159 return deriveAPIUrl()
160}
161
162// Server-side only - always returns full URL (never relative path)
163// Use this in Server Components, API routes, and server-side data fetching

Callers 15

getInstanceInfoFunction · 0.90
useActivityVersionsFunction · 0.90
useActivityStateFunction · 0.90
getDiscussionsKeyFunction · 0.90
AccessTabFunction · 0.90
GlobalAnalyticsFunction · 0.90
handleSubmitFunction · 0.90
UserListFunction · 0.90
OrganizationListFunction · 0.90
OrgPickerFunction · 0.90
EndpointDetailFunction · 0.90

Calls 2

isOnCustomDomainFunction · 0.85
deriveAPIUrlFunction · 0.85

Tested by

no test coverage detected