Skip to content

Instantly share code, notes, and snippets.

@omarkurt
Created June 17, 2018 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omarkurt/c5b92d8a8599111313870c77434980ef to your computer and use it in GitHub Desktop.
Save omarkurt/c5b92d8a8599111313870c77434980ef to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/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!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment