File: ping.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 (13 lines) | stat: -rw-r--r-- 353 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
from http import HTTPStatus

import falcon
from falcon.asgi import Request
from falcon.asgi import Response


class Pong:
    async def on_get(self, req: Request, resp: Response) -> None:
        resp.content_type = falcon.MEDIA_TEXT
        resp.text = 'PONG\n'
        # TODO(vytas): Properly type Response.status.
        resp.status = HTTPStatus.OK