Created
July 3, 2013 15:52
-
-
Save 0atman/5919669 to your computer and use it in GitHub Desktop.
Simple flask-restful GET json stub
This file contains hidden or 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
from flask import Flask | |
from flask.ext.restful import Resource, Api | |
app = Flask(__name__) | |
api = Api(app) | |
class SimpleRest(Resource): | |
def get(self): | |
return { | |
u'Description': u'I specialise in functional Python in massively-scalable devops environments.', | |
u'Name': u'Tristram Oaten, BSc. MSc.', | |
u'Technologies': [ | |
u'javascript', | |
u'python', | |
u'linux', | |
u'postgres', | |
u'scala', | |
u'couchdb' | |
], | |
u'Twitter': u'@0atman'} | |
api.add_resource(SimpleRest, '/') | |
if __name__ == '__main__': | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment