MCPcopy
hub / github.com/lukeautry/tsoa / buildServers

Method buildServers

packages/cli/src/swagger/specGenerator3.ts:143–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 }
142
143 protected buildServers() {
144 const prefix = this.config.disableBasePathPrefixSlash ? undefined : '/';
145 const basePath = normalisePath(this.config.basePath as string, prefix, undefined, false);
146 const scheme = this.config.schemes ? this.config.schemes[0] : 'https';
147 const hosts = this.config.servers ? this.config.servers : this.config.host ? [this.config.host!] : undefined;
148 const convertHost = (host: string) => ({ url: `${scheme}://${host}${basePath}` });
149 return (hosts?.map(convertHost) || [{ url: basePath }]) as Swagger.Server[];
150 }
151
152 protected buildSchema() {
153 const schema: { [name: string]: Swagger.Schema3 } = {};

Callers 2

GetSpecMethod · 0.95
GetSpecMethod · 0.80

Calls 1

normalisePathFunction · 0.90

Tested by

no test coverage detected