From af9ab012a3763e3046d8c42a8af8fd5c06e3df04 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 7 Aug 2023 12:16:12 +0300 Subject: Add routes to the application --- gn_auth/misc_views.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gn_auth/misc_views.py (limited to 'gn_auth/misc_views.py') diff --git a/gn_auth/misc_views.py b/gn_auth/misc_views.py new file mode 100644 index 0000000..bd2ad62 --- /dev/null +++ b/gn_auth/misc_views.py @@ -0,0 +1,18 @@ +""" +Miscellaneous top-level views that have nothing to do with the application's +functionality. +""" +from pathlib import Path + +from flask import Blueprint + +misc = Blueprint("misc", __name__) + +@misc.route("/version") +def version(): + """Get the application's version information.""" + version_file = Path("VERSION.txt") + if version_file.exists(): + with open(version_file, encoding="utf-8") as verfl: + return verfl.read().strip() + return "0.0.0" -- cgit v1.2.3