add auto-doc support

This commit is contained in:
Yun Xu
2017-07-01 23:46:34 -07:00
parent fd5faeb5dd
commit 3fff685c44
6 changed files with 42 additions and 1 deletions

View File

@@ -99,7 +99,16 @@ class Router:
return name, _type, pattern
def add(self, uri, methods, handler, host=None, strict_slashes=False):
"""Add a handler to the route list
:param uri: path to match
:param methods: sequence of accepted method names. If none are
provided, any method is allowed
:param handler: request handler function.
When executed, it should provide a response object.
:param strict_slashes: strict to trailing slash
:return: Nothing
"""
# add regular version
self._add(uri, methods, handler, host)