Add `DEBUG` environment variable to toggle Sanic debugging
continuous-integration/drone Build is passing Details

This commit is contained in:
Lauri Võsandi 2022-02-27 14:16:33 +02:00 committed by Lauri Võsandi
parent a7158d7580
commit 2ab39f879d
1 changed files with 3 additions and 1 deletions

View File

@ -481,6 +481,8 @@ async def setup_db(app, loop):
monitor(app).expose_endpoint()
try:
app.run(host="0.0.0.0", port=5000)
app.run(host="0.0.0.0",
port=5000,
debug=bool(os.getenv("DEBUG", 0)))
except KeyboardInterrupt:
asyncio.get_event_loop().close()