Skip to content

Commit

Permalink
update Demo and README
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Dec 12, 2024
1 parent 3b4c2b0 commit 455ddee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@ Don't be surprised if the first loading time of the Webpage is very long (about
using Stipple
using Stipple.ReactiveTools
using StippleUI
import Genie.Server.openbrowser

using StippleMakie

Stipple.enable_model_storage(false)

# ------------------------------------------------------------------------------------------------

# if required set a different port, url or proxy_port for Makie's websocket communication, e.g.
# otherwise, Genie's settings are applied for listen_url and proxy_url and Makie's (Bonito's) settings are applied for the ports
configure_makie_server!(listen_port = 8001)
# if required set a different port, url or proxy_port for Makie's websocket communication, e.g. 8001
# if not specified, Genie's settings are applied for listen_url and proxy_url and Makie's (Bonito's) settings
# are applied for the ports
# configure_makie_server!(listen_port = 8001)

# Example settings for a proxy configuration:
# proxy_host and proxy_port will be taken from the serving port, just specify a different path
configure_makie_server!(listen_port = 8001, proxy_url = "/makie")
# specify the proxy_port explicitly
# configure_makie_server!(listen_port = 8001, proxy_url = "/makie", proxy_port = 8080)


# The appropriate nginx configuration can be generated using `nginx_config()` either after setting the configuration
# or by passing the desired settings directly to the function.
# nginx_config()
startproxy(8080)

@app MakieDemo begin
@out fig1 = MakieFigure()
Expand Down Expand Up @@ -66,7 +68,8 @@ route("/") do
# page(model, ui, prepend = makie_dom(model)) |> html
end

up(open_browser = true)
up()
openbrowser("http://localhost:8080")
```
![Form](docs/demoapp.png)

Expand Down
7 changes: 4 additions & 3 deletions examples/StippleMakieDemo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ Stipple.enable_model_storage(false)
# configure_makie_server!(listen_port = 8001)

# Example settings for a proxy configuration:
# proxy_host and proxy_port will be taken from the serving port, just specify a different path
configure_makie_server!(listen_port = 8001, proxy_url = "/makie")
# specify the proxy_port explicitly
configure_makie_server!(listen_port = 8001, proxy_url = "/makie", proxy_port = 8080)
# proxy_port will be taken from the serving port
#configure_makie_server!(listen_port = 8001, proxy_url = "/makie")
# configure_makie_server!(listen_port = 8001, proxy_url = "/makie", proxy_port = 8080)

startproxy(8080)

# in production settings it might be favorable to use a reverse proxy for the websocket communication, e.g. nginx.
Expand Down

0 comments on commit 455ddee

Please sign in to comment.