bottin-ag/webhandler/webhandler.go

29 lines
522 B
Go

// Package webhandler provides handlers for the web app routes
package webhandler
import (
"net/http"
"git.agecem.com/agecem/bottin-ag/webresponse"
"github.com/labstack/echo/v4"
)
func DeclareRoutes(e *echo.Echo, h *WebHandler) {
e.GET("/", h.IndexGET)
}
type WebHandler struct {
}
func New() WebHandler {
return WebHandler{}
}
func (w *WebHandler) IndexGET(c echo.Context) error {
var r webresponse.IndexGET
r.Message = "foo"
r.StatusCode = http.StatusOK
return c.Render(r.StatusCode, "index-html", r)
}