mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 14:12:16 +08:00
Merge 3a391685bac007101d69081a846afbd50a196bb7 into e2212d40c62a98b388a5eb48ecbdcf88534688ba
This commit is contained in:
commit
cbb1029995
17
README.md
17
README.md
@ -1,12 +1,7 @@
|
|||||||
|
|
||||||
#Gin Web Framework
|
# Gin Web Framework
|
||||||
|
|
||||||
<img align="right" src="https://raw.githubusercontent.com/gin-gonic/gin/master/logo.jpg">
|
<img align="right" src="https://raw.githubusercontent.com/gin-gonic/gin/master/logo.jpg"> [](https://travis-ci.org/gin-gonic/gin) [](https://codecov.io/gh/gin-gonic/gin) [](https://goreportcard.com/report/github.com/gin-gonic/gin) [](https://godoc.org/github.com/gin-gonic/gin) [](https://gitter.im/gin-gonic/gin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
[](https://travis-ci.org/gin-gonic/gin)
|
|
||||||
[](https://codecov.io/gh/gin-gonic/gin)
|
|
||||||
[](https://goreportcard.com/report/github.com/gin-gonic/gin)
|
|
||||||
[](https://godoc.org/github.com/gin-gonic/gin)
|
|
||||||
[](https://gitter.im/gin-gonic/gin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
||||||
|
|
||||||
Gin is a web framework written in Go (Golang). It features a martini-like API with much better performance, up to 40 times faster thanks to [httprouter](https://github.com/julienschmidt/httprouter). If you need performance and good productivity, you will love Gin.
|
Gin is a web framework written in Go (Golang). It features a martini-like API with much better performance, up to 40 times faster thanks to [httprouter](https://github.com/julienschmidt/httprouter). If you need performance and good productivity, you will love Gin.
|
||||||
|
|
||||||
@ -133,7 +128,7 @@ func main() {
|
|||||||
func main() {
|
func main() {
|
||||||
router := gin.Default()
|
router := gin.Default()
|
||||||
|
|
||||||
// This handler will match /user/john but will not match neither /user/ or /user
|
// This handler will match /user/john but will not match /user/ or /user
|
||||||
router.GET("/user/:name", func(c *gin.Context) {
|
router.GET("/user/:name", func(c *gin.Context) {
|
||||||
name := c.Param("name")
|
name := c.Param("name")
|
||||||
c.String(http.StatusOK, "Hello %s", name)
|
c.String(http.StatusOK, "Hello %s", name)
|
||||||
@ -372,7 +367,7 @@ func main() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###Multipart/Urlencoded binding
|
### Multipart/Urlencoded binding
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@ -450,7 +445,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
####Serving static files
|
#### Serving static files
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func main() {
|
func main() {
|
||||||
@ -464,7 +459,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
####HTML rendering
|
#### HTML rendering
|
||||||
|
|
||||||
Using LoadHTMLTemplates()
|
Using LoadHTMLTemplates()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user