feat: Refactor blueprints to make them easier to import
All checks were successful
Build Docker / BuildImage (push) Successful in 47s

This commit is contained in:
2025-10-30 18:22:21 +11:00
parent 4c654fcb78
commit 03dae87272
11 changed files with 62 additions and 71 deletions

View File

@@ -1,15 +1,15 @@
from flask import Blueprint, render_template, make_response, request, jsonify, send_from_directory, redirect
import os
wk_bp = Blueprint('well-known', __name__)
app = Blueprint('well-known', __name__, url_prefix='/.well-known')
@wk_bp.route("/<path:path>")
@app.route("/<path:path>")
def index(path):
return send_from_directory(".well-known", path)
@wk_bp.route("/wallets/<path:path>")
@app.route("/wallets/<path:path>")
def wallets(path):
if path[0] == "." and 'proof' not in path:
return send_from_directory(
@@ -28,7 +28,7 @@ def wallets(path):
return render_template("404.html"), 404
@wk_bp.route("/nostr.json")
@app.route("/nostr.json")
def nostr():
# Get name parameter
name = request.args.get("name")
@@ -50,7 +50,7 @@ def nostr():
)
@wk_bp.route("/xrp-ledger.toml")
@app.route("/xrp-ledger.toml")
def xrp():
# Create a response with the xrp-ledger.toml file
with open(".well-known/xrp-ledger.toml") as file: