|
12 | 12 | Sockets.send(p::WSConnection, data) = writeguarded(p.sock, JSON.json(data)) |
13 | 13 | Base.isopen(p::WSConnection) = isopen(p.sock) |
14 | 14 |
|
15 | | -if !isfile(GENERIC_HTTP_BUNDLE_PATH) |
16 | | - error( |
17 | | - "Unable to find WebIO JavaScript bundle for generic HTTP provider; " |
18 | | - * "try rebuilding WebIO (via `Pkg.build(\"WebIO\")`)." |
19 | | - ) |
20 | | -end |
21 | | -const bundle_key = AssetRegistry.register(GENERIC_HTTP_BUNDLE_PATH) |
| 15 | +# Ref constant because we need to retreive it in __init__ |
| 16 | +const bundle_key = Ref{String}("") |
22 | 17 |
|
23 | 18 | include(joinpath(@__DIR__, "..", "..", "deps", "mimetypes.jl")) |
24 | 19 |
|
@@ -111,7 +106,7 @@ function WebIOServer( |
111 | 106 | else # relative url |
112 | 107 | string("http://", baseurl, ":", http_port, WebIO.baseurl[]) |
113 | 108 | end |
114 | | - string(base, bundle_key) |
| 109 | + string(base, bundle_key[]) |
115 | 110 | end |
116 | 111 | wait_time = 5; start = time() # wait for max 5 s |
117 | 112 | while time() - start < wait_time |
@@ -144,7 +139,7 @@ function global_server_config() |
144 | 139 | ws_default = string("ws://", url, ":", http_port, "/webio_websocket/") |
145 | 140 | ws_url = get(ENV, "WEBIO_WEBSOCKT_URL", ws_default) |
146 | 141 | # make it possible, to e.g. host the bundle online |
147 | | - bundle_url = get(ENV, "WEBIO_BUNDLE_URL", string(WebIO.baseurl[], bundle_key)) |
| 142 | + bundle_url = get(ENV, "WEBIO_BUNDLE_URL", string(WebIO.baseurl[], bundle_key[])) |
148 | 143 | webio_server_config[] = ( |
149 | 144 | url = url, bundle_url = bundle_url, |
150 | 145 | http_port = http_port, ws_url = ws_url |
|
0 commit comments