Skip to content

Instantly share code, notes, and snippets.

@hbradio
Created September 21, 2016 17:56
Show Gist options
  • Save hbradio/d96f55e9834a4583b76c295f0ab85ef9 to your computer and use it in GitHub Desktop.
Save hbradio/d96f55e9834a4583b76c295f0ab85ef9 to your computer and use it in GitHub Desktop.
# A very simple Flask Hello World app for you to get started with...
from flask import Flask
app = Flask(__name__)
current_status = 'uninitialized'
@app.route('/')
def hello_world():
return 'Hello from Flask!!'
@app.route('/status/<string:status>', methods=['POST'])
def handlestatus(status):
current_status = status
print "Got some status: " + status
return ('', 200)
@app.route('/status', methods=['GET'])
def getstatus():
return current_status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment