Align Flask app with Nubes template
This commit is contained in:
+2
-1
@@ -1,2 +1,3 @@
|
|||||||
Flask>=3.0
|
Flask>=3.0
|
||||||
gunicorn>=21.2
|
gunicorn>=21.2
|
||||||
|
requests>=2.31
|
||||||
+3
-15
@@ -1,29 +1,17 @@
|
|||||||
import platform
|
|
||||||
from datetime import datetime, timezone
|
|
||||||
|
|
||||||
from flask import Flask, jsonify, render_template
|
from flask import Flask, jsonify, render_template
|
||||||
import flask
|
|
||||||
|
|
||||||
|
|
||||||
VERSION = "0.0.1"
|
|
||||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
return render_template(
|
return render_template("index.html")
|
||||||
"index.html",
|
|
||||||
version=VERSION,
|
|
||||||
current_time=datetime.now(timezone.utc).isoformat(),
|
|
||||||
python_version=platform.python_version(),
|
|
||||||
flask_version=flask.__version__,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/health")
|
@app.route("/health")
|
||||||
def health():
|
def health():
|
||||||
return jsonify(status="ok", version=VERSION)
|
return jsonify(status="ok")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True, host="0.0.0.0", port=5000)
|
app.run(host="0.0.0.0", port=5000)
|
||||||
@@ -10,12 +10,6 @@
|
|||||||
<main>
|
<main>
|
||||||
<h1>Recipe handwriting recognition</h1>
|
<h1>Recipe handwriting recognition</h1>
|
||||||
<p>Managed Flask server is running.</p>
|
<p>Managed Flask server is running.</p>
|
||||||
<dl>
|
|
||||||
<dt>Version</dt><dd>{{ version }}</dd>
|
|
||||||
<dt>UTC time</dt><dd>{{ current_time }}</dd>
|
|
||||||
<dt>Python</dt><dd>{{ python_version }}</dd>
|
|
||||||
<dt>Flask</dt><dd>{{ flask_version }}</dd>
|
|
||||||
</dl>
|
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user