Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getMuxWSUrl for location.pathname other than "/" #396

Merged

Conversation

etpinard
Copy link
Contributor

fixes #382


Manually tested with the following:

  • in ~/.julia/dev/WebIO/ :
pkg> test WebIO

this builds the JS bundles under deps/bundles/ (and also runs the tests locally)

  • in some tmp folder
pkg> activate .
pkg> add Interact Mux
pkg> dev WebIO
pkg> st
  [c601a237] Interact v0.10.3
  [a975b10e] Mux v0.7.1
  [0f1e0344] WebIO v0.8.13 [`~/.julia/dev/WebIO`]

julia> using WebIO, Interact, Mux
   
julia> function gui()
           but = button("click me")
           on(but) do _
               println("was clicked")
           end
           but
       end
gui (generic function with 1 method)

julia> Mux.@app app = (Mux.defaults,
                       page("/", req->gui()),
                       page("/hallo", req->gui()),
                       page("/hallo/hello", req->gui()),
                       Mux.notfound())

julia> webio_serve(app, 8000)
Task (runnable) @0x00007f359a5adae0

where the button works on http://localhost:8000/, http://localhost:8000/hallo and http://localhost:8000/hallo/hello


Please let me know if you want me to (try to) add a tests for this. Thank you!

cc @cstjean

@shashi
Copy link
Member

shashi commented Apr 14, 2020

Looks good to me. cc @travigd

@twavv twavv self-requested a review April 14, 2020 18:33
@twavv
Copy link
Member

twavv commented Apr 14, 2020

Travis-CI failures are unrelated. LGTM.

@twavv twavv merged commit de95ec7 into JuliaGizmos:master Apr 14, 2020
@etpinard etpinard deleted the webio-interact-mux-non-root-route-issue branch April 14, 2020 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebIO + Interact + Mux does not work on pages other than "/"
3 participants