/test-axum

Primary LanguageRustMIT LicenseMIT

AXUM WASIX STARTER

This repo contains a starter project for building a Wasix based axum web server.

Compiling the project

$ cargo wasix build

Running the project

$ wasmer run target/wasm32-wasmer-wasi/release/wasix-axum.wasm --net --env PORT=8080
Listening on http://127.0.0.1:8080

Note: The PORT environment variable is required to run the server locally. On edge this defaults to 80 because Wasmer edge expects the server to listen on port 80 and it will proxy the request to the server.

Deploy to Wasmer Edge

  1. Login to wasmer-cli
$ wasmer login
  1. Replace wasix-org username in wasmer.toml and deploy.toml with your username

    Note: wasmer.toml is for publishing the image to wasmer registry and deploy.toml is for deploying the image to wasmer-edge

  2. Deploy to wasmer-edge
$ wasmer deploy

Checkout the full tutorial here

This project is available on wasmer edge:

Available on https://wasix-axum-example.wasmer.app