Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (22 sloc) 0.639 kB
import time
def app(environ, start_response):
path_info = environ['PATH_INFO']
if path_info == '/slow':
time.sleep(1)
body = b'slow'
else:
body = b'quick'
cl = str(len(body))
start_response(
'200 OK',
[('Content-Length', cl), ('Content-Type', 'text/plain')])
return [body]
if __name__ == '__main__':
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
h = NullHandler()
logging.getLogger('waitress').addHandler(h)
from waitress import serve
serve(app, port=61523, _quiet=True, expose_tracebacks=True)
Jump to Line
Something went wrong with that request. Please try again.