MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / run

Function run

test-programs/tests/axum_hello_world.rs:15–30  ·  view source on GitHub ↗

The hello_world.rs and hello_world_nomacro.rs are identical in functionality

(guest: &str)

Source from the content-addressed store, hash-verified

13// The hello_world.rs and hello_world_nomacro.rs are identical in
14// functionality
15fn run(guest: &str) -> Result<()> {
16 // Run wasmtime serve.
17 let _serve = test_programs::WasmtimeServe::new(guest)?;
18
19 // Test each path in the server:
20
21 // TEST / handler
22 // Response body is the hard-coded default
23 let body: String = ureq::get("http://127.0.0.1:8081")
24 .call()?
25 .body_mut()
26 .read_to_string()?;
27 assert!(body.contains("<h1>Hello, World!</h1>"));
28
29 Ok(())
30}

Callers 2

hello_worldFunction · 0.85
hello_world_nomacroFunction · 0.85

Calls 1

getFunction · 0.85

Tested by

no test coverage detected