Created
November 15, 2016 16:53
-
-
Save nazarsa/4eb2922175802283fc481eefbe5867b8 to your computer and use it in GitHub Desktop.
Cloud Foundry Starter - Python 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
from flask import Flask | |
import os | |
app = Flask(__name__) | |
port = int(os.getenv("PORT", 9099)) | |
@app.route('/') | |
def starter_app(): | |
return 'CF App ' + str(os.getenv("CF_INSTANCE_INDEX", 0)) | |
if __name__ == '__main__': | |
# Run the app, listening on all IPs with our chosen port number | |
app.run(host='0.0.0.0', port=port) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment