Skip to content
Snippets Groups Projects
Commit e35b6358 authored by Benedikt's avatar Benedikt
Browse files

changed server start skript and url only port 5008 now no sufix

parent 5cbf072b
No related branches found
No related tags found
No related merge requests found
......@@ -125,11 +125,15 @@ def make_doc(doc):
logger.addHandler(file_handler)
logger.setLevel(logging.DEBUG)
logger.info('This is bokeh_tableTool ...')
logger.info("This is bok dcc_XMLJSONConvGUI ...")
hostname = socket.gethostname()
IPAddr = socket.gethostbyname(hostname)
logger.info("Opening Bokeh application on http://" + str(hostname) + ":5003/")
logger.info("Opening Bokeh application on http://" + str(IPAddr) + ":5003/")
try:
IPAddr = socket.gethostbyname(hostname)
except Exception as e:
logger.warning("Maybe there is something wrong with your /etc/hosts \n" + e)
IPAddr = "localhost"
logger.info("Opening Bokeh application on http://" + str(hostname) + ":5008/")
logger.info("Opening Bokeh application on http://" + str(IPAddr) + ":5008/")
myPage = Page()
doc.add_root(myPage.page)
doc.title = "DCC XML/JSON Rest API GUI"
......@@ -149,22 +153,26 @@ from bokeh.server.server import Server
def main():
"""Launch the server and connect to it.
"""
print("Preparing a bokeh application.")
print("Preparing dcc_XMLJSONConvGUI application.")
io_loop = IOLoop.current()
bokeh_app = Application(FunctionHandler(make_doc))
server = Server({"/DCCRestAPIGUI": bokeh_app},
server = Server({"": bokeh_app},
io_loop=io_loop,
http_server_kwargs={'max_buffer_size': 900000000},
websocket_max_message_size=500000000,
port=5003,
port=5008,
allow_websocket_origin=['*']
)
server.start()
hostname = socket.gethostname()
IPAddr = socket.gethostbyname(hostname)
print("Opening Bokeh application on http://" + str(hostname) + ":5003/")
print("Opening Bokeh application on http://" + str(IPAddr) + ":5003/")
try:
IPAddr = socket.gethostbyname(hostname)
except Exception as e:
print("Maybe there is something wrong with your /etc/hosts \n" + e)
IPAddr = "localhost"
print("Opening Bokeh application on http://" + str(hostname) + ":5008/")
print("Opening Bokeh application on http://" + str(IPAddr) + ":5008/")
io_loop.add_callback(server.show, "/")
io_loop.start()
......
#!/bin/bash
cd /dcc_XMLJSONConvGUI
uvicorn dcc_server:app --host 0.0.0.0 --port 8000 --root-path /dcc_rest_server &
bokeh serve --show dcc_XMLJSONConvGUI.py --allow-websocket-origin "*" --port 5010
\ No newline at end of file
python3 dcc_XMLJSONConvGUI.py --allow-websocket-origin "*" --port 5008
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment