diff --git a/fedn/network/api/server.py b/fedn/network/api/server.py index bb4df7369..d56c3ab0b 100644 --- a/fedn/network/api/server.py +++ b/fedn/network/api/server.py @@ -2,11 +2,11 @@ from flask import Flask, jsonify, request +from fedn.common.config import get_controller_config from fedn.network.api.auth import jwt_auth_required from fedn.network.api.interface import API -from fedn.network.api.shared import statestore,control +from fedn.network.api.shared import control, statestore from fedn.network.api.v1 import _routes -from fedn.common.config import get_controller_config custom_url_prefix = os.environ.get("FEDN_CUSTOM_URL_PREFIX", False) # statestore_config,modelstorage_config,network_id,control=set_statestore_config() @@ -626,9 +626,14 @@ def list_combiners_data(): if custom_url_prefix: app.add_url_rule(f"{custom_url_prefix}/list_combiners_data", view_func=list_combiners_data, methods=["POST"]) + def start_server_api(): config = get_controller_config() port = config["port"] debug = config["debug"] - host="0.0.0.0" - app.run(debug=debug, port=port,host=host) + host = "0.0.0.0" + app.run(debug=debug, port=port, host=host) + + +if __name__ == "__main__": + start_server_api()