Added documentation to README

Signed-off-by: Salim Afiune <salim@afiunemaya.com.mx>
This commit is contained in:
Salim Afiune 2017-07-31 09:52:43 -04:00
parent 90833a73e8
commit 05e2d87d95
1 changed files with 9 additions and 0 deletions

View File

@ -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