Mercurial > hg > simpypi
changeset 3:f5360bb59e41
this now serves
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 27 Feb 2012 16:12:43 -0800 |
parents | b03602153de2 |
children | 7caedb575794 |
files | simpypi/factory.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/simpypi/factory.py Mon Feb 27 16:05:34 2012 -0800 +++ b/simpypi/factory.py Mon Feb 27 16:12:43 2012 -0800 @@ -22,7 +22,7 @@ def factory(**app_conf): """create a webob view and wrap it in middleware""" app = Dispatcher(**app_conf) - return HTTPExceptionHandler(PassthroughFileserver(app, resource_filename(__name__, 'static'))) + return PassthroughFileserver(app, resource_filename(__name__, 'static')) if __name__ == '__main__': import shutil @@ -30,6 +30,8 @@ from wsgiref import simple_server tempdir = tempfile.mkdtemp() try: - app = factory + app = factory(directory=tempdir) + server = simple_server.make_server(host='0.0.0.0', port=8080, app=app) + server.serve_forever() finally: shutil.rmtree(tempdir)