Hi,
I have this piece of Flask code loading a bokeh server
@app.route('/candlechart')
def candleChart():
refAsset = request.args.get('ref')
tradeAsset = request.args.get('trade')
# Retrieve the script to include the bokeh app to the page.
script = server_document("/bokeh_server/candle_chart", relative_urls=True, arguments={"ref":refAsset, "trade":tradeAsset})
return render_template("candleChart.html", script=script, template="Flask")
My nginx config transforms
localhost/bokeh_server/candle_chart
to
localhost:5006/candle_chart
And is also configured to access the flask server using the /flask url. For example, to access the candlechart page of the Flask server I use : localhost/flask/candlechart
So the URL used to start the bokeh server app is :
localhost/flask/candlechart?ref=EUR&trade=BTC
In bokeh 1.3.4 this is working fine.
In browser console I have :
Bokeh: injecting script tag for BokehJS library: https://cdn.pydata.org/bokeh/release/bokeh-1.3.4.min.js autoload.js:79:15
...
Bokeh: all BokehJS libraries/stylesheets loaded
which is fine.
When try with 1.4.0, bokeh doesn’t load.
In browser console I have
Bokeh: injecting script tag for BokehJS library: static/js/bokeh.min.js?v=ac90935137e13ae0b2c6583f2e1f3fe8
...
Le script à l’adresse « http://localhost/flask/static/js/bokeh.min.js?v=ac90935137e13ae0b2c6583f2e1f3fe8 » a été chargé alors que son type MIME (« text/html ») n’est pas un type MIME JavaScript valide.
candlechart
failed to load static/js/bokeh-gl.min.js?v=817fa55a6e55d1e469275e21c9b77565 autoload.js:57:15
on_error http://localhost/bokeh_server/candle_chart/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/bokeh_server/candle_chart&ref=EUR&trade=BTC:57
It only says “failed to load” only for bokeh-gl.min.js but the MIME type warning is there for all of the .js
Is there a way to :
- load the resources through the CDN like in 1.3.4
or - make the local resources loading work (I guess this one would be preferable)
Thanks !