diff --git a/README.md b/README.md index c8df7c8..e910d22 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ uv sync uv run arcmapper ``` +This will run arcmapper in production mode. During development it is helpful to +see debug information, to do so run arcmapper with the `-d` or `--debug` flag. + ## Usage The browser should open with the ARCMapper interface diff --git a/src/arcmapper/__init__.py b/src/arcmapper/__init__.py index 2f77327..d5ca4f8 100644 --- a/src/arcmapper/__init__.py +++ b/src/arcmapper/__init__.py @@ -1,4 +1,5 @@ import os +import sys import time import socket import logging @@ -60,6 +61,10 @@ def wait_for_server( def main(): + if len(sys.argv) > 1 and sys.argv[1] in ["--debug", "-d"]: + print("Using debug mode...") + app.run_server(debug=True) + return if check_port(ARCMAPPER_HOST, ARCMAPPER_PORT): logging.info("Port is already in use. Opening browser.") webbrowser.open(f"http://{ARCMAPPER_HOST}:{ARCMAPPER_PORT}")