Correct sanic.router.Router documentation

This commit is contained in:
Hyunjun Kim 2017-01-02 13:29:31 +09:00
parent 552ff9d736
commit cfdd9f66d1

View File

@ -31,12 +31,12 @@ class Router:
""" """
Router supports basic routing with parameters and method checks Router supports basic routing with parameters and method checks
Usage: Usage:
@sanic.route('/my/url/<my_parameter>', methods=['GET', 'POST', ...]) @app.route('/my_url/<my_param>', methods=['GET', 'POST', ...])
def my_route(request, my_parameter): def my_route(request, my_param):
do stuff... do stuff...
or or
@sanic.route('/my/url/<my_paramter>:type', methods['GET', 'POST', ...]) @app.route('/my_url/<my_param:my_type>', methods=['GET', 'POST', ...])
def my_route_with_type(request, my_parameter): def my_route_with_type(request, my_param: my_type):
do stuff... do stuff...
Parameters will be passed as keyword arguments to the request handling Parameters will be passed as keyword arguments to the request handling