File: echo.go

package info (click to toggle)
golang-github-appleboy-gofight 2.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 212 kB
  • sloc: makefile: 50
file content (24 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package example

import (
	"net/http"

	"github.com/labstack/echo/v4"
)

func echoHelloHandler() echo.HandlerFunc {
	return func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello World")
	}
}

// EchoEngine is echo router.
func EchoEngine() *echo.Echo {
	// Echo instance
	e := echo.New()

	// Routes
	e.GET("/", echoHelloHandler())

	return e
}