Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed Apr 1, 2024
1 parent 51bc4fd commit 93eece6
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ async def widget(widget_name):
port = int(os.environ.get("ONBOARD_PORT", 9830))
debug = bool(os.environ.get("FLASK_DEBUG", "False"))
print(f"Running on port {port} with debug={debug}")
if debug:
app.run(port=port, debug=debug)
else:
from hypercorn.config import Config
from hypercorn.asyncio import serve
config = Config()
config.accesslog="-"
config.errorlog="-"
config.loglevel="DEBUG"
config.bind = f"0.0.0.0:{port}"
print(asyncio.run(serve(app, config)))
app.run(port=port, debug=debug)
# if debug:
# app.run(port=port, debug=debug)
# else:
# from hypercorn.config import Config
# from hypercorn.asyncio import serve
# config = Config()
# config.accesslog="-"
# config.errorlog="-"
# config.loglevel="DEBUG"
# config.bind = f"0.0.0.0:{port}"
# print(asyncio.run(serve(app, config)))

0 comments on commit 93eece6

Please sign in to comment.