fastly compute serve
Build and run a Compute package locally.
Syntax
$ fastly compute serve
Options
Key | Required? | Default | Description |
---|---|---|---|
--addr | No | 127.0.0.1:7676 | The IPv4 address and port to listen on |
--dir | No | Project directory to build (default: current directory) | |
--env | No | The manifest environment config to use (e.g. 'stage' will attempt to read 'fastly.stage.toml') | |
--file | No | The Wasm file to run (causes build process to be skipped) | |
--include-source | No | Include source code in built package | |
--language | No | Language type | |
--metadata-disable | No | Disable Wasm binary metadata annotations | |
--metadata-filter-envvars | No | Redact specified environment variables from [scripts.env_vars] using comma-separated list | |
--metadata-show | No | Inspect the Wasm binary metadata | |
--package-name | No | Package name | |
--profile-guest | No | Profile the Wasm guest under Viceroy (requires Viceroy 0.9.1 or higher). View profiles at https://profiler.firefox.com/. | |
--profile-guest-dir | No | The directory where the per-request profiles are saved to. Defaults to guest-profiles. | |
--skip-build | No | Skip the build step | |
--timeout | No | Timeout, in seconds, for the build compilation step | |
--viceroy-args | No | Additional arguments to pass to the Viceroy binary, separated by space | |
--viceroy-check | No | Force the CLI to check for a newer version of the Viceroy binary | |
--viceroy-path | No | The path to a user installed version of the Viceroy binary | |
--watch | No | Watch for file changes, then rebuild project and restart local server | |
--watch-dir | No | The directory to watch files from (can be relative or absolute). Defaults to current directory. |
Global options
Key | Required? | Default | Description |
---|---|---|---|
--help | No | Show context-sensitive help. | |
--accept-defaults | No | Accept default options for all interactive prompts apart from Yes/No confirmations | |
--auto-yes | No | Answer yes automatically to all Yes/No confirmations. This may suppress security warnings | |
--debug-mode | No | Print API request and response details (NOTE: can disrupt the normal CLI flow output formatting) | |
--enable-sso | No | Enable Single-Sign On (SSO) for current profile execution (see also: 'fastly sso') | |
--non-interactive | No | Do not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes | |
--profile | No | Switch account profile for single command execution (see also: 'fastly profile switch') | |
--quiet | No | Silence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive) | |
--token | No | Fastly API token (or via FASTLY_API_TOKEN) | |
--verbose | No | Verbose logging |
Examples
Build and run a Compute package locally
The compute serve
command wraps the existing build command. All flags present on the fastly compute build command are available to use here. Additionally, the --watch
command enables 'hot reloading' of your project code whenever changes are made to the source code.
$ fastly compute serve --watch