Skip to content

Instantly share code, notes, and snippets.

@ykyuen
Created November 19, 2018 06:04
Show Gist options
  • Save ykyuen/0247a4ef928c21364fed452beb694121 to your computer and use it in GitHub Desktop.
Save ykyuen/0247a4ef928c21364fed452beb694121 to your computer and use it in GitHub Desktop.
setup-nested-html-template-in-go-echo-web-framework-02
package main
import (
"net/http"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
})
e.GET("/json", func(c echo.Context) error {
return c.JSONBlob(
http.StatusOK,
[]byte(`{ "id": "1", "msg": "Hello, Boatswain!" }`),
)
})
e.Logger.Fatal(e.Start(":1323"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment