MCPcopy
hub / github.com/GitbookIO/gitbook / getDefaultServerURL

Function getDefaultServerURL

packages/react-openapi/src/util/server.ts:6–14  ·  view source on GitHub ↗
(servers: OpenAPIV3.ServerObject[])

Source from the content-addressed store, hash-verified

4 * Get the default URL for the server.
5 */
6export function getDefaultServerURL(servers: OpenAPIV3.ServerObject[]): string {
7 const server = servers[0];
8 if (!server) {
9 // Return empty string if no server is found to display nothing
10 return '';
11 }
12
13 return interpolateServerURL(server);
14}
15
16/**
17 * Interpolate the server URL with the default values of the variables.

Callers 3

OpenAPIPathFunction · 0.90
generateCodeSamplesFunction · 0.90
server.test.tsFile · 0.90

Calls 1

interpolateServerURLFunction · 0.85

Tested by

no test coverage detected