Skip to content

Commit

Permalink
fix(api): get admin token from correct server object
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 22, 2023
1 parent 4ac25f0 commit 6fecb1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def script(obj, optimize=True, _frames_up=0, _rcb=None):

# create the server and load the config
from onnx_web.main import main
server, app, pool = main()
context, app, pool = main()

# launch the image workers
print("starting image workers")
Expand All @@ -39,7 +39,7 @@ def script(obj, optimize=True, _frames_up=0, _rcb=None):
# launch the user's web browser
print("opening web browser")
url = "http://127.0.0.1:5000"
webbrowser.open_new_tab(f"{url}?api={url}&token={server.admin_token}")
webbrowser.open_new_tab(f"{url}?api={url}&token={context.admin_token}")

# wait for enter and exit
input("press enter to quit")
Expand Down

0 comments on commit 6fecb1e

Please sign in to comment.