Skip to content

Commit

Permalink
add __main__
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrede committed Jul 11, 2024
1 parent 4ce2eb0 commit 1e739c3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions fedn/network/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

0 comments on commit 1e739c3

Please sign in to comment.