How to use the bespoken-tools/lib/core/global.Global.initializeCLI function in bespoken-tools

To help you get started, we’ve selected a few bespoken-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bespoken-cookbook / serverless-plugin-bespoken / src / ServerlessPluginBespoken.ts View on Github external
proxyStart = async () => {
    // create the bespoken config file if properties are specified in serverless config
    await this.loadBespokenPluginConfig();

    // initialize the bespoken cli
    await Global.initializeCLI();

    // enable verbose logging
    LoggingHelper.setVerbose(true);

    // ensure environment variables from serverless config are set
    mutateProcessEnvironmentVariables(
      this.environmentVariablesFromServerlessConfig
    );

    // create the lambda proxy
    if (this.withPassThruRoutingOption == null) {
      // run local server in 'single function mode' -- all requests are dispatched to a single lambda specified either on command line or
      // by choosing first function from serverless config ...
      const handler = extractHandlerObject(
        this.functionsFromServerlessConfig,
        this.selectedFunctionFromCommandLine