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

Function buildConfig

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

Source from the content-addressed store, hash-verified

120}
121
122function buildConfig(args, env = process.env) {
123 let routes = { ...args.routes };
124
125 // Merge env routes
126 if (env.INGRESS_ROUTES) {
127 try {
128 const envRoutes = JSON.parse(env.INGRESS_ROUTES);
129 routes = { ...routes, ...envRoutes };
130 } catch (e) {
131 console.error("Failed to parse INGRESS_ROUTES:", e.message);
132 }
133 }
134
135 return {
136 port: args.port || parseInt(env.INGRESS_PORT, 10) || 8000,
137 routes,
138 defaultBackend: args.defaultBackend || env.INGRESS_DEFAULT || null,
139 runtimeServicesInfo:
140 args.runtimeServicesInfo || env.INGRESS_RUNTIME_SERVICES_INFO || null,
141 };
142}
143
144// ═══════════════════════════════════════════════════════════════════════════
145// Server

Callers 3

mainFunction · 0.90
ingress.mjsFile · 0.70

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected