From 8cc9946c11a079d48393c1cb25b57e60fd14f5f6 Mon Sep 17 00:00:00 2001 From: adikal25 <89134183+adikal25@users.noreply.github.com> Date: Wed, 29 May 2024 06:09:49 +0000 Subject: [PATCH 1/2] "resolved mac-os(arm),linux os local host problem" --- app/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/app.py b/app/app.py index d060138..691d9b8 100644 --- a/app/app.py +++ b/app/app.py @@ -275,6 +275,9 @@ def update_tesseract_path(): if __name__ == "__main__": host = "localhost" port = 5000 + if os.name == 'posix': + port = 5001 # or 5002 as needed + app.run(port=port) logging.basicConfig(filename="app.log", filemode="w", level=logging.DEBUG, format="%(levelname)s - %(message)s") print("[*] Starting OcrRoo Server") print(f"[*] OcrRoo Server running on http://{host}:{port}/") From 6f6f5d707b7f4589fe7ae973f204e789516c02db Mon Sep 17 00:00:00 2001 From: Jayden <158142194+jayden-tafe@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:02:00 +0800 Subject: [PATCH 2/2] Update app.py fix: Removed the first app.run (app.run(port=port)) --- app/app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/app.py b/app/app.py index 691d9b8..f11d420 100644 --- a/app/app.py +++ b/app/app.py @@ -275,9 +275,8 @@ def update_tesseract_path(): if __name__ == "__main__": host = "localhost" port = 5000 - if os.name == 'posix': - port = 5001 # or 5002 as needed - app.run(port=port) + if os.name == 'posix': + port = 5001 logging.basicConfig(filename="app.log", filemode="w", level=logging.DEBUG, format="%(levelname)s - %(message)s") print("[*] Starting OcrRoo Server") print(f"[*] OcrRoo Server running on http://{host}:{port}/")