From efc359459c943d0c6e3448b3630e7b554f881c70 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 21 Apr 2024 12:34:47 +1000 Subject: [PATCH] feat: Add nostr.json route --- server.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index dd761ae..cc2e357 100644 --- a/server.py +++ b/server.py @@ -108,7 +108,18 @@ def wallet(path): return redirect('/.well-known/wallets/' + path.upper(), code=302) return render_template('404.html'), 404 - + +@app.route('/.well-known/nostr.json') +def nostr(): + # Get name parameter + name = request.args.get('name') + if not name: + return jsonify({'error': 'No name provided'}) + return jsonify({ + 'names': { + name: 'b57b6a06fdf0a4095eba69eee26e2bf6fa72bd1ce6cbe9a6f72a7021c7acaa82' + } + }) # Main routes