Last active
December 17, 2015 02:39
-
-
Save natehefner/5537664 to your computer and use it in GitHub Desktop.
Basic JSON REST API using the Flask web microframework.
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
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