Skip to content

Instantly share code, notes, and snippets.

@textbook
Forked from ihuston/Flask on CF.md
Last active March 8, 2016 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save textbook/012328d900c6800e91ee to your computer and use it in GitHub Desktop.
Save textbook/012328d900c6800e91ee to your computer and use it in GitHub Desktop.
Simple Flask application for Cloud Foundry

Simple Python Flask app on Cloud Foundry

This is a (very) simple Flask application that shows how the built-in Python buildpack detection on Cloud Foundry works.

To push to Cloud Foundry, log in and then use

$ cf push myapp-name

Python on Cloud Foundry

Cloud Foundry: http://cloudfoundry.org

  • Python is a first class language
  • Deploy with cf push myapp
  • Scale with cf scale myapp ...

You can try Cloud Foundry by signing up for a free trial at Pivotal Web Services.

"""Cloud Foundry test"""
from flask import Flask
import os
app = Flask(__name__)
port = int(os.getenv("PORT"))
@app.route('/')
def hello_world():
return 'Hello World! I am running on port ' + str(port)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=port)
web: python hello.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment