feat: Add url support
All checks were successful
Build Docker / BuildImage (push) Successful in 34s
Check Code Quality / RuffCheck (push) Successful in 42s

This commit is contained in:
2025-11-20 17:00:22 +11:00
parent b4c6fec0bd
commit 3117288872
2 changed files with 78 additions and 8 deletions

View File

@@ -1,7 +1,6 @@
from flask import (
Flask,
make_response,
request,
render_template,
send_from_directory,
send_file,
@@ -70,11 +69,30 @@ def wellknown(path):
# region Main routes
@app.route("/")
def index():
# Print the IP address of the requester
print(f"Request from IP: {request.remote_addr}")
# And the headers
print(f"Request headers: {request.headers}")
# Get current time in the format "dd MMM YYYY hh:mm AM/PM"
current_datetime = datetime.now().strftime("%d %b %Y %I:%M %p")
return render_template("index.html", datetime=current_datetime)
@app.route("/tx/<path:tx_hash>")
def tx_route(tx_hash):
current_datetime = datetime.now().strftime("%d %b %Y %I:%M %p")
return render_template("index.html", datetime=current_datetime)
@app.route("/block/<path:block_id>")
def block_route(block_id):
current_datetime = datetime.now().strftime("%d %b %Y %I:%M %p")
return render_template("index.html", datetime=current_datetime)
@app.route("/address/<path:address>")
def address_route(address):
current_datetime = datetime.now().strftime("%d %b %Y %I:%M %p")
return render_template("index.html", datetime=current_datetime)
@app.route("/name/<path:name>")
def name_route(name):
current_datetime = datetime.now().strftime("%d %b %Y %I:%M %p")
return render_template("index.html", datetime=current_datetime)