mirror of
https://github.com/wolfswolke/DeathGarden_API_Rebirth.git
synced 2026-03-26 04:04:58 -05:00
51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
"""
|
|
|
|
"""
|
|
# ------------------------------------------------------- #
|
|
# imports
|
|
# ------------------------------------------------------- #
|
|
from threading import Thread
|
|
import time
|
|
|
|
from flask_definitions import *
|
|
import endpoints.unknown
|
|
import endpoints.user_handeling
|
|
import endpoints.general
|
|
import endpoints.logging
|
|
import endpoints.debug
|
|
import endpoints.web
|
|
import endpoints.matchmaking
|
|
|
|
|
|
# ------------------------------------------------------- #
|
|
# functions
|
|
# ------------------------------------------------------- #
|
|
|
|
|
|
def run():
|
|
app.run(host='0.0.0.0', port=8080)
|
|
|
|
|
|
def keep_alive():
|
|
try:
|
|
t = Thread(target=run)
|
|
t.daemon = True
|
|
t.start()
|
|
while True:
|
|
time.sleep(100)
|
|
except (KeyboardInterrupt, SystemExit):
|
|
print('Received keyboard interrupt, quitting threads.')
|
|
logger.graylog_logger(level="info", handler="api", message={"event": "api stopped."})
|
|
|
|
|
|
# ------------------------------------------------------- #
|
|
# global variables
|
|
# ------------------------------------------------------- #
|
|
|
|
|
|
# ------------------------------------------------------- #
|
|
# main
|
|
# ------------------------------------------------------- #
|
|
logger.setup_graylog(use_graylog, graylog_server)
|
|
keep_alive()
|