33 lines
1021 B
Python
33 lines
1021 B
Python
from flask import current_app as app, render_template, jsonify
|
|
from datetime import datetime
|
|
from flask_login import login_required
|
|
|
|
|
|
@app.route("/")
|
|
@app.route("/index.html")
|
|
def index():
|
|
scriptfile = "{0}_{1}.js".format(app.config["PROJEKTNAME"], app.config["APPVERSION"])
|
|
if app.config["DEBUG"] is False:
|
|
scriptfile = scriptfile.replace(".js", ".min.js")
|
|
return render_template(
|
|
"index.html",
|
|
apptitle = app.config["PROJEKTNAME"],
|
|
scriptfile = scriptfile
|
|
)
|
|
|
|
@app.route("/xhr/health-check")
|
|
def health_check():
|
|
zeit = datetime.now().isoformat()
|
|
result = {
|
|
'result': "success",
|
|
'time': zeit,
|
|
'server': "n/a", #_server,
|
|
'projectname': "n/a", #_projektname,
|
|
'clientappversion': "N/A" #_version
|
|
}
|
|
return result # https://flask.palletsprojects.com/en/3.0.x/quickstart/#about-responses
|
|
|
|
@app.route("/xhr/getinfo")
|
|
@login_required
|
|
def get_info():
|
|
return {"info": "pustekuchen"} |