Skip to content

Instantly share code, notes, and snippets.

@nazarsa
Created November 15, 2016 16:53
Show Gist options
  • Save nazarsa/4eb2922175802283fc481eefbe5867b8 to your computer and use it in GitHub Desktop.
Save nazarsa/4eb2922175802283fc481eefbe5867b8 to your computer and use it in GitHub Desktop.
Cloud Foundry Starter - Python Flask App
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