Skip to content

Instantly share code, notes, and snippets.

@natehefner
Last active December 17, 2015 02:39
Show Gist options
  • Save natehefner/5537664 to your computer and use it in GitHub Desktop.
Save natehefner/5537664 to your computer and use it in GitHub Desktop.
Basic JSON REST API using the Flask web microframework.
import os
import Flask, jsonify
@app.route('/')
def index():
json = jsonify(response="Hello World!")
return json
if __name__ == '__main__':
app.debug = True
port = int(os.environ.get('PORT', '5000'))
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