api layer v0.3.2 - /settings

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2025-08-31 09:54:56 +10:00
parent 7c9b37d827
commit fd3f1fc929
2 changed files with 65 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ CORS(
r"/history/*": {"origins": "*"},
r"/nettools/*": {"origins": "*"},
r"/sessions/*": {"origins": "*"},
r"/settings/*": {"origins": "*"},
r"/dbquery/*": {"origins": "*"},
r"/events/*": {"origins": "*"}
},
@@ -77,6 +78,17 @@ def graphql_endpoint():
return jsonify(response)
# --------------------------
# Settings Endpoints
# --------------------------
@app.route("/settings/<setKey>", methods=["GET"])
def api_get_setting(setKey):
if not is_authorized():
return jsonify({"error": "Forbidden"}), 403
value = get_setting_value(setKey)
return jsonify({"success": True, "value": value})
# --------------------------
# Device Endpoints
# --------------------------