From 0656d8a95da2a2b3d09790263e1125e529748e4f Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Fri, 20 Jun 2025 22:17:09 +1000 Subject: [PATCH] feat: Add more api info --- server.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server.py b/server.py index 3b0881e..e19c6d3 100644 --- a/server.py +++ b/server.py @@ -390,6 +390,28 @@ def donateAmountPost(amount): # endregion #region Other API routes +@app.route("/api/version") +def version(): + return jsonify({"version": getVersion()}) + +@app.route("/api/help") +def help(): + return jsonify({ + "message": "Welcome to Nathan.Woodburn/ API! This is a personal website. For more information, visit https://nathan.woodburn.au", + "endpoints": { + "/api/time": "Get the current time", + "/api/timezone": "Get the current timezone", + "/api/message": "Get the message from the config", + "/api/ip": "Get your IP address", + "/api/v1/project": "Get the current project from git", + "/api/version": "Get the current version of the website" + }, + "version": getVersion() + }) + + + + @app.route("/api/time") def time(): timezone_offset = datetime.timedelta(hours=ncConfig["time-zone"])