Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.35 KB

README.md

File metadata and controls

46 lines (32 loc) · 1.35 KB

Devcontainer WASM-dotnet

Simple devcontainer for dotnet development

Usage

Github Codespaces

Just click the button:

Open in GitHub Codespaces

Visual Studio Code

Note this assumes that you have the VS code support for remote containers and docker installed on your machine.

git clone https://github.com/dev-wasm/dev-wasm-dotnet
cd dev-wasm-dotnet
code ./

Visual studio should prompt you to see if you want to relaunch the workspace in a container, you do.

Building and Running

Simple example

dotnet build starter
wasmtime --dir . starter/bin/Debug/net7.0/starter.wasm

Web serving with WASI-HTTP

Web serving with WAGI

There is an example of web serving via WebAssembly + CGI (WAGI) in the www directory. It uses the lighttpd web server and mod_cgi. See the www/lighttpd.conf file for more details.

dotnet build www
lighttpd -D -f www/lighttpd.conf 

Once the server is running, VS Code or Codespaces should prompt you to connect to the open port.

HTTP Client

There is a more complicated example in the http directory which shows an example of making an HTTP client call using the experimental wasi+http support in wasi-http.