Skip to content

Commit

Permalink
Merge pull request #454 from Stefal/api_get_version
Browse files Browse the repository at this point in the history
simple api route
  • Loading branch information
Stefal authored Feb 6, 2025
2 parents 6cd5d52 + ac86526 commit 78f20c1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions web_app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import subprocess
import psutil
import distro
import socket

from werkzeug.security import generate_password_hash
from werkzeug.security import check_password_hash
Expand Down Expand Up @@ -531,6 +532,18 @@ def diagnostic():
return render_template('diagnostic.html', logs = logs)


@app.route('/api/v1/infos', methods=['GET'])
def get_infos():
"""Small api route to get basic informations about the base station"""

infos = {"app" : "RTKBase",
"app_version" : rtkbaseconfig.get("general", "version"),
"url" : html.escape(request.base_url),
"fqdn" : socket.getfqdn(),
"uptime" : get_uptime(),
"hostname" : socket.gethostname()}
return json.dumps(infos)

#### Handle connect/disconnect events ####

@socketio.on("connect", namespace="/test")
Expand Down

0 comments on commit 78f20c1

Please sign in to comment.