Created
January 27, 2024 16:58
-
-
Save augustovictor/a361fe30066c5bae22c197d1c052aa2d to your computer and use it in GitHub Desktop.
Simple python app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- app.py --- | |
from flask import Flask, jsonify | |
import os | |
app = Flask(__name__) | |
@app.route('/health') | |
def health(): | |
return 'Healthy', 200 | |
@app.route('/env') | |
def env_variables(): | |
# Filter environment variables | |
vars = {key: value for key, value in os.environ.items() if key.startswith("APP_")} | |
return jsonify(vars) | |
if __name__ == '__main__': | |
app.run(host='0.0.0.0', port=5000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment