Skip to content
__init__.py 987 B
Newer Older
# -*- coding: UTF-8 -*-

from flask import Blueprint
from flask import jsonify, session, redirect, url_for

import config
adm_view = Blueprint( "adm", __name__ )
@adm_view.route( "/ping" )
def ping():
    """
        Ping function to check if the web application is healthy.
    """
    return "pong"

@adm_view.route( "/version" )
def route_version():
Marco De Donno's avatar
Marco De Donno committed
        Function to report the version of the web app. The version.py file is
        re-generated by the CI/CD for production.
    """
    try:
        return jsonify( {
            "error": False,
            "version": version.__version__,
            "branch": version.__branch__,
            "commit": version.__commit__,
            "commiturl": version.__commiturl__,
            "treeurl": version.__treeurl__
        } )

    except:
        return jsonify( {
            "error": True
        } )

@adm_view.route( "/favicon.ico" )
def favicon():
    return ""