MCPcopy Create free account
hub / github.com/KartikLabhshetwar/foliox / constructor

Method constructor

lib/utils/api-client.ts:14–22  ·  view source on GitHub ↗
(baseUrl?: string, apiKey?: string)

Source from the content-addressed store, hash-verified

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")) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected