diff options
Diffstat (limited to 'docs/narr/helloworld.py')
| -rw-r--r-- | docs/narr/helloworld.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/narr/helloworld.py b/docs/narr/helloworld.py index c01329af9..d384a0620 100644 --- a/docs/narr/helloworld.py +++ b/docs/narr/helloworld.py @@ -4,13 +4,13 @@ from pyramid.response import Response def hello_world(request): - return Response('Hello %(name)s!' % request.matchdict) + return Response('Hello World!') + if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/hello/{name}') - config.add_view(hello_world, route_name='hello') - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8080, app) + with Configurator() as config: + config.add_route('hello', '/') + config.add_view(hello_world, route_name='hello') + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 6543, app) server.serve_forever() - |
