gunicorn/benchmarks/simple_app.py
2026-01-23 01:20:03 +01:00

19 lines
444 B
Python

# Simple WSGI app for benchmarking
def application(environ, start_response):
"""Basic hello world response."""
path = environ.get('PATH_INFO', '/')
if path == '/large':
body = b'X' * 65536 # 64KB
else:
body = b'Hello, World!'
status = '200 OK'
headers = [
('Content-Type', 'text/plain'),
('Content-Length', str(len(body))),
]
start_response(status, headers)
return [body]