gunicorn/test.py
Paul J. Davis 8be0226763 Some refactoring work.
Remoed alot of code before starting to add more. Trimmed as much as
possible to get to the point that I understood what was going on in each
place.

Split the server code into multiple objects to help my sanity. Arbiter
is now the main class in the master process that keeps track of child
processes and so on and such forth.

The Worker class is responsible for handling incoming requests from the
server socket passed to its constructor.
2009-12-03 01:13:38 -05:00

16 lines
392 B
Python

from gunicorn.httpserver import WSGIServer
def simple_app(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
response_headers = [('Content-type','text/plain')]
start_response(status, response_headers)
return ['Hello world!\n']
if __name__ == '__main__':
server = WSGIServer(("127.0.0.1", 8000), 1, simple_app)
server.run()