forked from themoeway/local-audio-yomichan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
660bef7
commit 2ce7049
Showing
1 changed file
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |