Merge pull request #19 from JD557/patch-1

Update routing.md <PARAM>
This commit is contained in:
channelcat 2016-10-15 13:39:17 -07:00 committed by GitHub
commit dc5143584d

View File

@ -1,6 +1,6 @@
# Routing
Sanic comes with a basic router that supports request parameters. To specify a parameter, surround it with carrots like so: <PARAM>. Request parameters will be passed to the request handler functions as keyword arguments. To specify a type, add a :type after the parameter name, in the carrots. If the parameter does not match the type supplied, Sanic will throw a NotFound exception, resulting in a 404 page not found error.
Sanic comes with a basic router that supports request parameters. To specify a parameter, surround it with carrots like so: `<PARAM>`. Request parameters will be passed to the request handler functions as keyword arguments. To specify a type, add a :type after the parameter name, in the carrots. If the parameter does not match the type supplied, Sanic will throw a NotFound exception, resulting in a 404 page not found error.
## Examples
@ -29,4 +29,4 @@ async def person_handler(request, person_id):
async def folder_handler(request, folder_id):
return text('Folder - {}'.format(folder_id))
```
```