1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-23 21:29:26 +02:00
echo/examples/hello/server.go

29 lines
383 B
Go
Raw Normal View History

package main
import (
"net/http"
"github.com/labstack/echo"
mw "github.com/labstack/echo/middleware"
)
// Handler
func hello(c *echo.Context) error {
return c.String(http.StatusOK, "Hello, World!\n")
}
func main() {
// Echo instance
e := echo.New()
// Middleware
e.Use(mw.Logger())
e.Use(mw.Recover())
// Routes
e.Get("/", hello)
// Start server
e.Run(":1323")
}