wiki/structured/assets/challenges.suse-cloud-native-fundamentals-scholarship-program/python-helloworld-app.py
2021-06-21 10:56:10 +08:00

18 lines
346 B
Python

from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/status")
def health_check():
return { "result": "OK - healthy" }
@app.route("/metrics")
def metrics():
return { "data": { "UserCount": 140, "UserCountActive": 23} }
if __name__ == "__main__":
app.run(host='0.0.0.0')