Skip to content

Instantly share code, notes, and snippets.

@augustovictor
Created January 27, 2024 16:58
Show Gist options
  • Save augustovictor/a361fe30066c5bae22c197d1c052aa2d to your computer and use it in GitHub Desktop.
Save augustovictor/a361fe30066c5bae22c197d1c052aa2d to your computer and use it in GitHub Desktop.
Simple python app
# --- 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