diff --git a/server.py b/server.py index d150e5f..8226cb7 100644 --- a/server.py +++ b/server.py @@ -68,6 +68,26 @@ def wellknown(path): req.content, 200, {"Content-Type": req.headers["Content-Type"]} ) +@app.route("/verify", methods=["GET"]) +def verify_domain(): + # Get the domain from the query string + domain = request.args.get("domain") + if not domain: + return jsonify({"error": "No domain provided"}), 400 + + # Get path from env + apiKEY = os.getenv("API_KEY") + # Get host or use 127.0.0.1 + host = os.getenv("HSD_HOST", "127.0.0.1") + nameInfo = requests.post( + f"http://x:{apiKEY}@{host}:12037", + json={ + "method": "getnameinfo", + "params": [domain] + } + ) + return jsonify(nameInfo.json()), 200 + @app.route("/renew", methods=["POST"]) def renew(): # Get post data