mirror of https://github.com/gin-gonic/gin.git
Added documentation to README
Signed-off-by: Salim Afiune <salim@afiunemaya.com.mx>
This commit is contained in:
parent
90833a73e8
commit
05e2d87d95
|
@ -855,6 +855,15 @@ r.GET("/test", func(c *gin.Context) {
|
||||||
```
|
```
|
||||||
Both internal and external locations are supported.
|
Both internal and external locations are supported.
|
||||||
|
|
||||||
|
### HTML rendering from String
|
||||||
|
|
||||||
|
For services that doesn't want to store HTML files on disk, you can use the `StringHTML()` method that will render an HTML from the provided `String`:
|
||||||
|
|
||||||
|
```go
|
||||||
|
r.GET("/index", func(c *gin.Context) {
|
||||||
|
c.StringHTML(200, "<html><body><h2>Bienvenido a Gin Server!</h2></body></html>")
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
### Custom Middleware
|
### Custom Middleware
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue