fastly compute serve
Build and run a Compute@Edge 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 |
--env | No | The environment configuration to use (e.g. stage) | |
--file | No | bin/main.wasm | The Wasm file to run |
--include-source | No | Include source code in built package | |
--language | No | Language type | |
--package-name | No | Package name | |
--skip-build | No | Skip the build step | |
--timeout | No | Timeout, in seconds, for the build compilation step | |
--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 | |
--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@Edge 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