diff --git a/config/app/variables/cli/cli.json b/config/app/variables/cli/cli.json index 2d59f7016..590ae2fe0 100644 --- a/config/app/variables/cli/cli.json +++ b/config/app/variables/cli/cli.json @@ -65,7 +65,9 @@ } }, "options": { - "usage": "node ./bin/server.js [args]" + "usage": "node ./bin/server.js [args]", + "envVarPrefix": "CSS", + "loadFromEnv": true } } ] diff --git a/src/init/AppRunner.ts b/src/init/AppRunner.ts index 5e2d77677..cdf1aecba 100644 --- a/src/init/AppRunner.ts +++ b/src/init/AppRunner.ts @@ -22,6 +22,8 @@ const CORE_CLI_PARAMETERS = { mainModulePath: { type: 'string', alias: 'm', requiresArg: true }, } as const; +const ENV_VAR_PREFIX = 'CSS'; + /** * A class that can be used to instantiate and start a server based on a Component.js configuration. */ @@ -112,7 +114,9 @@ export class AppRunner { .usage('node ./bin/server.js [args]') .options(CORE_CLI_PARAMETERS) // We disable help here as it would only show the core parameters - .help(false); + .help(false) + // We also read from environment variables + .env(ENV_VAR_PREFIX); const params = await yargv.parse();