Skip to content

Commit

Permalink
Print configuration at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyscarborough committed Sep 3, 2023
1 parent 660bef7 commit 2ce7049
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
from plugin.db_utils import attempt_init_db
from plugin.consts import BIND_ADDRESS, BIND_PORT
from plugin.consts import (
BIND_ADDRESS,
BIND_PORT,
CONFIG_DIRECTORY,
DATA_DIRECTORY,
EXTERNAL_URL
)
from plugin.server import LocalAudioHandler
import http
import threading

if __name__ == "__main__":
print("Initializing database...")
print("\nUsing configuration:")
print(f"- BIND_ADDRESS: {BIND_ADDRESS}")
print(f"- BIND_PORT: {BIND_PORT}")
print(f"- EXTERNAL_URL: {EXTERNAL_URL}")
print(f"- DATA_DIRECTORY: {DATA_DIRECTORY}")
print(f"- CONFIG_DIRECTORY: {CONFIG_DIRECTORY}")
print("\nInitializing database...")
attempt_init_db()
print("Starting server...")
print(f"Database is initialized, server will now start...")
server = http.server.ThreadingHTTPServer((BIND_ADDRESS, BIND_PORT), LocalAudioHandler)
server.serve_forever()
server.serve_forever()

0 comments on commit 2ce7049

Please sign in to comment.