-
Notifications
You must be signed in to change notification settings - Fork 115
Configuring the Emulator
The Google Cloud Functions Emulator accepts configuration from three sources with the following precedence: command-line arguments, configuration file, and default settings.
For example, by default the CLI will talk to the Emulator over REST (HTTP1.1). For a single operation, you could make it use gRPC (HTTP2):
functions call helloWorld --service=grpc
Or make it always use gRPC:
functions config set service grpc
functions call helloWorld
For an explanation of all configuration settings, run the following:
functions config --help
The Emulator's CLI uses the configstore library to persist configuration settings to a config.json
file located in your user's home directory.
For information on managing the config file, run:
functions config --help
You can print the contents of the config file with the following:
functions config list
Updating a value is easy:
functions config set verbose true
The Emulator must be restarted for changes to the config file to take effect.
Many commands available in the CLI take a number of optional flags which can be used to configure settings for a single operation. Run the following to get info on what flags are available for a command:
functions <command> --help
Use the config file if your want your settings to persist across restarts of the Emulator.
You can view the default configuration settings with:
functions config defaults
Disclaimer: This is not an official Google product.
@google-cloud/functions-emulator is currently in pre-1.0.0 development. Before the 1.0.0 release, backwards compatible changes and bug fixes will bump the patch version number and breaking changes will bump the minor version number.