Skip to content

Quickstart for WASM Edge Code using Swift

This Quickstart uses the github.com/kateinoigakukun/swift-fastly-edge-example example, which uses the github.com/AndrewBarba/swift-compute-runtime SDK.

Prerequisites

  1. Install the Swift WASM toolchain from the links at SwiftWASM.org
  2. Install the Fastly CLI

Quickstart using the CLI:

$ /Library/Developer/Toolchains/swift-wasm-5.5.0-RELEASE.xctoolchain/usr/bin/swift build --triple wasm32-unknown-wasi --product FastlyEdgeExample -c release
$ fastly compute init
$ fastly compute pack --wasm-binary=./.build/release/FastlyEdgeExample.wasm
$ fastly compute deploy

Additional Approachs

See the following pages for using alternative methods for packaging, uploading and activation.

  1. Packaging includes information on file structure for creation using Go and manually
  2. Uploading & Activating includes information on uploading using the CLI, Fastly Management Console, API, Go SDk, JS SDK and PHP SDK.