diff --git a/example-projects/reqwest-wasm-example/README.md b/example-projects/reqwest-wasm-example/README.md index 23fb417..fd7ce9d 100644 --- a/example-projects/reqwest-wasm-example/README.md +++ b/example-projects/reqwest-wasm-example/README.md @@ -1,13 +1,23 @@ ## Example usage of CLoudEvents sdk/Reqwest from WASM -Install the dependencies with: +First, ensure you have [`wasm-pack` installed](https://rustwasm.github.io/wasm-pack/installer/) + +Then install the dependencies: npm install -Then build the example locally with: +And finally run the example: npm run serve -and then visiting http://localhost:8080 in a browser should run the example! +You should see a form in your browser at http://localhost:8080. When +the form is submitted, a CloudEvent will be sent to the Target URL, +http://localhost:9000 by default, which is the default URL for the +[actix example](../actix-web-example). Fire it up in another terminal +to verify that the data is successfully sent and received. -This example is loosely based off of [this example](https://github.com/rustwasm/wasm-bindgen/blob/master/examples/fetch/src/lib.rs), an example usage of `fetch` from `wasm-bindgen`, and from [reqwest repo](https://github.com/seanmonstar/reqwest/tree/master/examples/wasm_github_fetch). \ No newline at end of file +Open the javascript console in the browser to see any helpful error +messages. + +This example is loosely based off of [this +example](https://github.com/seanmonstar/reqwest/tree/master/examples/wasm_github_fetch). diff --git a/example-projects/reqwest-wasm-example/index.html b/example-projects/reqwest-wasm-example/index.html index e4b969a..c4575d2 100644 --- a/example-projects/reqwest-wasm-example/index.html +++ b/example-projects/reqwest-wasm-example/index.html @@ -13,7 +13,7 @@