support-organizer/backend/fgo-request-manager/__main__.py

26 lines
854 B
Python
Raw Normal View History

2023-09-26 20:00:26 +00:00
# pylint: disable=multiple-statements,wrong-import-position,wrong-import-order
from gevent.monkey import patch_all; patch_all()
from gevent.pywsgi import WSGIServer
2023-11-24 19:50:18 +00:00
from .app import Application
from .routes import routes
from .routes.requests import routes_requests
from .config import ServerSettings
2023-09-26 20:00:26 +00:00
instance = Application.get_instance()
app, api = instance.app, instance.api
2023-09-26 20:00:26 +00:00
api.register_blueprint(routes)
api.register_blueprint(routes_requests)
2023-09-26 20:00:26 +00:00
HOSTNAME = ServerSettings.HOSTNAME
PORT = ServerSettings.PORT
2023-09-26 20:00:26 +00:00
if __name__ == '__main__':
http_Server = WSGIServer((HOSTNAME, PORT), app)
2023-09-26 20:00:26 +00:00
try:
print(f"Server available on http://{HOSTNAME}:{PORT}/")
print(f"View docs on http://{HOSTNAME}:{PORT}/swagger")
2023-09-26 20:00:26 +00:00
http_Server.serve_forever()
except KeyboardInterrupt:
print("Keyboard interrupt received, stopping...")