How to create an edge function using WebAssembly on the Azion Edge platform
Learn about the required process to create an edge function that uses a WebAssembly originated function.
- On Azion Console, on the upper-left corner, select Edge Functions in the Edge Libraries section.
- Click Add a Function.
- Choose a name for your function.
- Under Language, select JavaScript.
- Copy and paste the following sample code to the code block:
The const wasmCode
is the binary representation of the following WAT code:
Note: WAT is the textual representation of the wasm binary format, used to enable WebAssembly to be read and edited by humans.
- Click the Save button.
Now, the function is ready to be instantiated in an edge application. Check how to instantiate and execute the functions in your edge application and try it out.
The expected output of the recently created function is similar to:
Contributors