From fade40c650ddc1c7d5104eecb98df9cadd2a2cef Mon Sep 17 00:00:00 2001 From: Ahoys123 Date: Mon, 9 Jan 2023 18:11:47 -0800 Subject: [PATCH] added to README-wasm.md --- README-wasm.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README-wasm.md b/README-wasm.md index 26db38a..faf9685 100644 --- a/README-wasm.md +++ b/README-wasm.md @@ -39,10 +39,11 @@ import ( ) func main() { - log.Fatal(http.ListenAndServe(":8080", - http.FileServer(http.Dir("/path/to/dir/to/serve")) - )) + log.Fatal(http.ListenAndServe(":8080", + http.FileServer(http.Dir("/path/to/dir/to/serve")), + )) } + ``` To see the webpage with this example, you can type in `localhost:8080/tcell.html` into your browser while `server.go` is running. @@ -51,4 +52,10 @@ To see the webpage with this example, you can type in `localhost:8080/tcell.html It is recomended to use an iframe if you want to embed the app into a webpage: ```html -``` \ No newline at end of file +``` + +## Other considerations + +### Accessing files + +`io.Open(filename)` and other related functions for reading file systems do not work; use `http.Get(filename)` instead. \ No newline at end of file