Created
November 19, 2018 06:34
-
-
Save ykyuen/42c06aedff402652586b64b984316202 to your computer and use it in GitHub Desktop.
setup-nested-html-template-in-go-echo-web-framework-12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package handler | |
import ( | |
"net/http" | |
"github.com/labstack/echo" | |
) | |
func AboutHandler(c echo.Context) error { | |
// Please note the the second parameter "about.html" is the template name and should | |
// be equal to one of the keys in the TemplateRegistry array defined in main.go | |
return c.Render(http.StatusOK, "about.html", map[string]interface{}{ | |
"name": "About", | |
"msg": "All about Boatswain!", | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment