From 00645e8d930effa6cc930ef52a9cbc033837e859 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Wed, 10 Jan 2018 12:47:47 -0600 Subject: [PATCH] allow specifying port for the API to listen on --- bot/management/commands/starthitomi.py | 2 +- hitomi/settings.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/management/commands/starthitomi.py b/bot/management/commands/starthitomi.py index ccf772a..934a6bb 100644 --- a/bot/management/commands/starthitomi.py +++ b/bot/management/commands/starthitomi.py @@ -44,7 +44,7 @@ class Command(BaseCommand): def handle(self, *args, **options): loop = asyncio.get_event_loop() handler = hitomi_api.make_handler() - api_server = loop.create_server(handler, '0.0.0.0', 8080) + api_server = loop.create_server(handler, '0.0.0.0', settings.API_PORT) futures = asyncio.gather(run_bot(), api_server) try: loop.run_until_complete(futures) diff --git a/hitomi/settings.py b/hitomi/settings.py index 9be5a33..a6501e2 100644 --- a/hitomi/settings.py +++ b/hitomi/settings.py @@ -135,6 +135,8 @@ WEATHER_WEATHER_UNDERGROUND_API_KEY = 'key' BOT_PLUGINS = [] +API_PORT = 7777 + # get local settings