-
-
Save JaleelNazir/d9299335ddbfdf30a02f5a19ae5fc662 to your computer and use it in GitHub Desktop.
Falcon Web Framework (http://falconframework.org)
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
# sample.py | |
import falcon | |
import json | |
class QuoteResource: | |
def on_get(self, req, resp): | |
"""Handles GET requests""" | |
quote = { | |
'quote': 'I\'ve always been more interested in the future than in the past.', | |
'author': 'Grace Hopper' | |
} | |
resp.body = json.dumps(quote) | |
api = falcon.API() | |
api.add_route('/quote', QuoteResource()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment