(baseUrl?: string, apiKey?: string)
| 12 | private apiKey: string |
| 13 | |
| 14 | constructor(baseUrl?: string, apiKey?: string) { |
| 15 | const envUrl = process.env.NEXT_PUBLIC_API_URL |
| 16 | const defaultUrl = typeof window === "undefined" |
| 17 | ? process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000" |
| 18 | : "" |
| 19 | |
| 20 | this.baseUrl = baseUrl || envUrl || defaultUrl |
| 21 | this.apiKey = apiKey || process.env.API_KEYS?.split(",")[0] || "" |
| 22 | } |
| 23 | |
| 24 | private getAbsoluteUrl(endpoint: string): string { |
| 25 | if (endpoint.startsWith("http")) { |
nothing calls this directly
no outgoing calls
no test coverage detected