MCPcopy Create free account
hub / github.com/ShipSecAI/studio / constructor

Method constructor

packages/backend-client/src/api-client.ts:38–57  ·  view source on GitHub ↗
(config: ClientConfig = {})

Source from the content-addressed store, hash-verified

36 private baseUrl: string;
37
38 constructor(config: ClientConfig = {}) {
39 this.baseUrl = config.baseUrl || 'http://localhost:3211';
40
41 this.client = createClient<paths>({
42 baseUrl: this.baseUrl,
43 headers: {
44 'Content-Type': 'application/json',
45 ...config.headers,
46 },
47 });
48
49 if (config.middleware) {
50 const middlewares = Array.isArray(config.middleware)
51 ? config.middleware
52 : [config.middleware];
53 for (const mw of middlewares) {
54 this.client.use(mw);
55 }
56 }
57 }
58
59 getBaseUrl(): string {
60 return this.baseUrl;

Callers

nothing calls this directly

Calls 1

useMethod · 0.80

Tested by

no test coverage detected