MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / buildConfig

Function buildConfig

scripts/ingress.mjs:146–168  ·  view source on GitHub ↗
(args, env = process.env)

Source from the content-addressed store, hash-verified

144}
145
146function buildConfig(args, env = process.env) {
147 let routes = { ...args.routes };
148
149 // Merge env routes
150 if (env.INGRESS_ROUTES) {
151 try {
152 const envRoutes = JSON.parse(env.INGRESS_ROUTES);
153 routes = { ...routes, ...envRoutes };
154 } catch (e) {
155 console.error("Failed to parse INGRESS_ROUTES:", e.message);
156 }
157 }
158
159 return {
160 port: args.port || parseInt(env.INGRESS_PORT, 10) || 8000,
161 host: resolveBindHost({ flag: args.host, env: env.INGRESS_HOST }),
162 routes,
163 defaultBackend: args.defaultBackend || env.INGRESS_DEFAULT || null,
164 noReferrerPrefixes: args.noReferrerPrefixes ?? [],
165 runtimeServicesInfo:
166 args.runtimeServicesInfo || env.INGRESS_RUNTIME_SERVICES_INFO || null,
167 };
168}
169
170// ═══════════════════════════════════════════════════════════════════════════
171// Server

Callers 3

mainFunction · 0.90
ingress.mjsFile · 0.70

Calls 2

resolveBindHostFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected