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
- Install the Swift WASM toolchain from the links at SwiftWASM.org
- 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.
- Packaging includes information on file structure for creation using Go and manually
- Uploading & Activating includes information on uploading using the CLI, Fastly Management Console, API, Go SDk, JS SDK and PHP SDK.