Skip to content

Commit 8608fb4

Browse files
SimonDanischshashi
authored andcommitted
add some documentation
1 parent 773062b commit 8608fb4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,32 @@ end
8383
webio_serve(page("/", req -> myapp(req)))
8484
```
8585

86+
- Generic **HTTP**
87+
88+
You can use the generic HTTP provider for any app - without the need to rely on WebIO.
89+
90+
```julia
91+
92+
# You can just create your own display function
93+
function Base.display(d::MyWebDisplay, m::MIME"application/webio", app)
94+
println(d.io, "outer html")
95+
# calling show will make sure a server is running and serves dependencies
96+
# from AssetRegistry and a websocket connection gets established.
97+
show(d.io, m, app) #<- prints the html + scripts webio needs to work into io
98+
println(d.io, "close outer html")
99+
end
100+
# You can customize the server via the following environment variables:
101+
102+
ENV["JULIA_WEBIO_BASEURL"] = "url/to/base/route" # e.g. if you have a proxy
103+
104+
url = ENV["WEBIO_SERVER_HOST_URL"] = "127.0.0.1" # the url you want the server to listen on
105+
http_port = ENV["WEBIO_HTTP_PORT"] = "8081" # the port you want the server to listen on
106+
# the url that the websocket connects to:
107+
ENV["WEBIO_WEBSOCKT_URL"] = string(url, ":", http_port, "/webio_websocket/")
108+
109+
```
110+
111+
86112
Composing content
87113
------------------
88114

0 commit comments

Comments
 (0)