Download src/server/server-options.ts from bolikoto/zcode-api: direct link, hf CLI and curl.
- Browser
- Download file 889 Bytes
-
https://huggingface.co/spaces/bolikoto/zcode-api/resolve/main/src/server/server-options.ts
- Command line
-
hf download hf://spaces/bolikoto/zcode-api/src/server/server-options.ts
-
curl -L -o server-options.ts https://huggingface.co/spaces/bolikoto/zcode-api/resolve/main/src/server/server-options.ts
889 Bytes
| /** | |
| * `startServer` option assembly shared by every entry that boots the proxy | |
| * in-process (serve / android / tui). | |
| */ | |
| import type { ProxyConfig } from "../config/types.js"; | |
| import type { AuthManager } from "../auth/manager.js"; | |
| import { ResponseStore } from "../responses/store.js"; | |
| /** Build `startServer` options, wiring the Responses store when its config gate is on. */ | |
| export function buildServerOptions( | |
| config: ProxyConfig, | |
| auth: AuthManager, | |
| debug: boolean, | |
| ): { config: ProxyConfig; auth: AuthManager; debug: boolean; responseStore?: ResponseStore } { | |
| const opts: { config: ProxyConfig; auth: AuthManager; debug: boolean; responseStore?: ResponseStore } = { config, auth, debug }; | |
| if (config.responses.enabled) { | |
| opts.responseStore = new ResponseStore({ maxEntries: config.responses.storeMaxEntries, ttlMs: config.responses.storeTtlMs }); | |
| } | |
| return opts; | |
| } | |