| Oct | NOV | Dec |
| 27 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Collection: github.com
CORS: add an optional custom function to validate the origin502cce2
github.com/labstack/echo/v4 which is the recommended
way of using Echo going forward.
For older versions, please use the latest v3 tag.
// go get github.com/labstack/echo/{version}
go get github.com/labstack/echo/v4
package main import ( "net/http" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" ) func main() { // Echo instance e := echo.New() // Middleware e.Use(middleware.Logger()) e.Use(middleware.Recover()) // Routes e.GET("/", hello) // Start server e.Logger.Fatal(e.Start(":1323")) } // Handler func hello(c echo.Context) error { return c.String(http.StatusOK, "Hello, World!") }