Serving it all up

Let's test our code out in the browser. From the VS Code terminal, make sure you're in the /book-examples folder and run the command to start up a local server:

serve -l 8080

It's important that you're in the /book-examples folder. If you try serving up the code in the /chapter-05-create-load-module folder only, you won't be able to use the loadWasm() function. If you open up your browser to http://127.0.0.1:8080/chapter-05-create-load-module/without-glue.html, you should see this:


Without glue code example running in the browser

Try pressing the Pause button; the caption should change to Start and the rectangle should stop moving. Clicking it again should cause the rectangle to start moving again.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset