Permalink
Browse files

add example showing root route

  • Loading branch information...
1 parent 177897f commit 609edeb26ed36ea31c282ef9752e5349b76624c2 Randall Leeds committed Mar 27, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 examples/test.py
  2. +1 −1 greins/app.py
View
3 examples/test.py
@@ -21,5 +21,6 @@ def app(environ, start_response):
mounts = {
'/hello': create_app('Hello, World!\n'),
'/goodbye': create_app('Goodbye, cruel World!\n'),
- '/multi': create_app('Two ', 'Chunks', '\n')
+ '/multi': create_app('Two ', 'Chunks', '\n'),
+ '': create_app('Root', '\n')
}
View
2 greins/app.py
@@ -99,7 +99,7 @@ def load_file(self, cf):
if r.endswith('/'):
self.logger.warning("Stripping trailing '/' from '%s'" % r)
r = r.rstrip('/')
- elif not r.startswith('/'):
+ if r and not r.startswith('/'):
self.logger.warning("Adding leading '/' to '%s'" % r)
r = '/' + r
if self._router.add_mount(r, a) != a:

0 comments on commit 609edeb

Please sign in to comment.