File: quote.py

package info (click to toggle)
python-falcon 4.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,172 kB
  • sloc: python: 33,608; javascript: 92; sh: 50; makefile: 50
file content (14 lines) | stat: -rw-r--r-- 368 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import falcon


class QuoteResource:
    def on_get(self, req: falcon.Request, resp: falcon.Response) -> None:
        """Handle GET requests."""
        resp.media = {
            'quote': "I've always been more interested in the future than in the past.",
            'author': 'Grace Hopper',
        }


app = falcon.App()
app.add_route('/quote', QuoteResource())