Created
February 12, 2017 02:19
-
-
Save jnmclarty/ed839679f3cf93420689f439c0457eef to your computer and use it in GitHub Desktop.
How to add an endpoint for environment info to any Flask App
This file contains 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
import json | |
# Assuming you've instantiated a Flask app... | |
from pyenvdiff import Environment | |
@app.route('/pyenv') | |
def pyenv(): | |
info = Environment().info() | |
resp = json.dumps(info) | |
return Response(resp, status=200, mimetype='application/json') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment