I would like to have a bokeh server instance be able to provide the same functionality but to multiple browser tabs / uris. This would be much easier than launching a separate instance and have to choose different free ports each time.
I don’t see why the route couldn’t be a regex but I’ve also never personally tried that (and no one has ever asked before). Have you made an attempt, and it didn’t work?
I beg your pardon - it does work. My first attempt was using the capture expression (\w+) rather than the uncaptured one \w+. The uncaptured one works fine.
from tornado.ioloop import IOLoop
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
from bokeh.plotting import figure
def app_function(doc):
path = doc.session_context.request.path
fig = figure(title=path)
doc.add_root(fig)
handler = FunctionHandler(app_function)
app = Application(handler)
# With the capture expression it does not work
# server = Server({r"/(\w+)": app}, port=5006, io_loop=IOLoop.current())
# This works however. Can be accessed as: http://locahost:5006/some_name
# and will then display 'some_name' as the title of the figure
server = Server({r"/\w+": app}, port=5006, io_loop=IOLoop.current())
IOLoop.current().start()