import ( "net/http" "github.com/labstack/echo" ) func main() { e := echo.New() e.GET("/", func(c echo.Context) error { c.Response().Header().Set(echo.HeaderServer, "HelloWorld") return c.String(http.StatusOK, "Hello, World!") }) e.Logger.Fatal(e.Start(":8080")) }
import ( "net/http" "github.com/labstack/echo" ) func main() { e := echo.New() e.GET("/redirect", func(c echo.Context) error { return c.Redirect(http.StatusMovedPermanently, "http://www.google.com") }) e.Logger.Fatal(e.Start(":8080")) }In this example, the server redirects the client's request to `http://www.google.com`. Overall, the `github.com.labstack.echo` package library provides a simple and efficient way to handle the client request and server response using the Context Response feature.