Add basic webcontent
This commit is contained in:
parent
2dec57d097
commit
f986c2e8e1
5 changed files with 75 additions and 0 deletions
|
@ -1,2 +1,29 @@
|
|||
// 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)
|
||||
}
|
||||
|
|
Reference in a new issue