Update router introduce

This commit is contained in:
vCaesar
2017-01-10 21:41:33 +08:00
parent 1b079e856a
commit 85d0f7f3bf
4 changed files with 4 additions and 4 deletions

View File

@@ -123,7 +123,7 @@ We can simulate `PUT` and `DELETE` requests by adding a hidden `_method` field i
```
This sample code shows you how to write a very basic REST application. Our resources are users, and we use different functions for different methods. Here, we imported a third-party package called `github.com/drone/routes`. We've already covered how to implement a custom router in previous chapters -the `drone/routes` package implements some very convenient router mapping rules that make it very convenient for implementing RESTful architecture. As you can see, REST requires you to implement different logic for different HTTP methods of the same resource.
This sample code shows you how to write a very basic REST application. Our resources are users, and we use different functions for different methods. Here, we imported a third-party package called `github.com/julienschmidt/httprouter`. We've already covered how to implement a custom router in previous chapters -the `julienschmidt/httprouter` package implements some very convenient router mapping rules that make it very convenient for implementing RESTful architecture. As you can see, REST requires you to implement different logic for different HTTP methods of the same resource.
## Summary