From 05e2d87d957fcc2f9d90bf5d8d5330028dbd78a6 Mon Sep 17 00:00:00 2001 From: Salim Afiune Date: Mon, 31 Jul 2017 09:52:43 -0400 Subject: [PATCH] Added documentation to README Signed-off-by: Salim Afiune --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index b14c2a2a..6aee8e90 100644 --- a/README.md +++ b/README.md @@ -855,6 +855,15 @@ r.GET("/test", func(c *gin.Context) { ``` 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, "

Bienvenido a Gin Server!

") +}) +``` ### Custom Middleware