(appName)
| 331 | } |
| 332 | |
| 333 | function appContext(appName) { |
| 334 | const config = JSON.parse( |
| 335 | fs.readFileSync(path.join(__dirname, "../apps.json"), "utf8"), |
| 336 | ); |
| 337 | const appConfig = config[appName]; |
| 338 | if (!appConfig) throw new Error(`App ${appName} not found in apps.json`); |
| 339 | |
| 340 | const subdomain = appConfig.subdomain || appName; |
| 341 | return { |
| 342 | appConfig, |
| 343 | subdomain, |
| 344 | project: `apps-${subdomain}`, |
| 345 | originDomain: `${subdomain}.${UPSTREAM_ZONE}`, |
| 346 | publicDomain: `${subdomain}.${PUBLIC_ZONE}`, |
| 347 | }; |
| 348 | } |
| 349 | |
| 350 | async function runOrigin(appName) { |
| 351 | const { appConfig, project, originDomain } = appContext(appName); |
no test coverage detected