With the appropriate structure in place for our Echo project, we can get started by expanding on our simple example Echo application from Chapter 1, Understanding HTTP, Go, and Echo.
The following code is located in the $GOPATH/src/github.com/PacktPublishing/Echo-Essentials/chapter2/cmd/service/main.go file:
package main import ( "github.com/PacktPublishing/Echo-Essentials/chapter2/handlers" "github.com/labstack/echo" ) func main() { // create a new echo instance e := echo.New() // Route / to handler function e.GET("/health-check", handlers.HealthCheck) // Authentication routes e.POST("/login", handlers.Login) e.POST("/logout", handlers.Logout) // start the server, and log if it fails e.Logger.Fatal(e.Start(":8080")) ...