From f5388a6cd8e8ce3f69d5fb4406bf3bea3bad9a4b Mon Sep 17 00:00:00 2001 From: Gaisberg Date: Tue, 24 Sep 2024 10:27:18 +0300 Subject: [PATCH] chore: add port startup argument --- src/main.py | 2 +- src/utils/cli.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index c32a4d14..84d9f8f7 100644 --- a/src/main.py +++ b/src/main.py @@ -100,7 +100,7 @@ def signal_handler(signum, frame): signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) -config = uvicorn.Config(app, host="0.0.0.0", port=8080, log_config=None) +config = uvicorn.Config(app, host="0.0.0.0", port=args.port, log_config=None) server = Server(config=config) with server.run_in_thread(): diff --git a/src/utils/cli.py b/src/utils/cli.py index 567bd83b..384596d8 100644 --- a/src/utils/cli.py +++ b/src/utils/cli.py @@ -33,6 +33,12 @@ def handle_args(): action="store_true", help="Start a Plex listener.", ) + parser.add_argument( + "-p", "--port", + type=int, + default=8080, + help='Port to run the server on (default: 8000)' + ) args = parser.parse_args()