Skip to content

An experiment server running WebAssembly System Interface functions

License

Notifications You must be signed in to change notification settings

fdionisi/wasi-faas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WASI faas

An experiment server running WebAssembly System Interface functions.

Built on top of Hyper and Wasmtime.

Abstract

In the past few yeras, it became quite common to hear buzz words such as WASM and WASI, function-as-a-service, and relatives.

With the advent of Deno, their Deploy service, the run to edge-function by Netlify, Superbase, and Vercel, aside of the well enstablished Cloudfront Workers, I wanted to join the trend with a small experiment.

After the intersting reading about the imminent Wasimtime 1.0 release, I decided to try building a very basic function-as-a-service platform to run WebAssembly System Interface executables in the cloud.

Similarly as for fast-cli and flagger, this project is also an opportunity to improve my Rust, in this case, diving deeper in the subject of proc_macro.

The project is developed with Zed.

Run the example

Ensure to have wasm32-wasi target.

rustup target add wasm32-wasi

Build the example with the above target.

cargo build --bin wasi-faas-example --target wasm32-wasi --release

And then run the server.

cargo run --release --bin wasi-faas -- --module-path ./target/wasm32-wasi/release/wasi-faas-example.wasm

By default, the server will listen publicly on port 8888. Any combination of HTTP methods and endpoints will run the target module.

curl --location --request POST 'http://localhost:8888/test-endpoint' \
  --header 'Content-Type: text/plain' \
  --data-raw 'Asd'

License

WASI faas is distributed under the terms of the MIT license.

See LICENSE for details.

About

An experiment server running WebAssembly System Interface functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages