view mamba/forest.py @ 328:af947a20c212

First server.
author Simon Cross <hodgestar@gmail.com>
date Fri, 16 Sep 2011 19:29:33 +0200
parents
children a2724d0078d8
line wrap: on
line source

"""Where mamba's hang out with each other."""

from wsgiref.simple_server import make_server


class ForestApp(object):
    """Where mamba's hang out and exchange levels."""

    def __call__(self, environ, start_response):
        status = '200 OK'
        headers = [('Content-type', 'text/plain')]
        start_response(status, headers)

        # The returned object is going to be printed
        return ["Hello World"]


if __name__ == "__main__":
    forest_app = ForestApp()
    httpd = make_server('', 8000, forest_app)
    httpd.serve_forever()