update/fix templates location

This commit is contained in:
cubixle
2022-07-22 14:04:10 +01:00
parent 99e5a09927
commit ff351c2f6f
3 changed files with 3 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
package http
import (
"net/http"
"github.com/labstack/echo/v4"
)
func (h *HTTP) DefaultHandler(c echo.Context) error {
return c.Render(http.StatusOK, "index.html", nil)
}
func (h *HTTP) DefaultErrorHandler(err error, c echo.Context) {
code := http.StatusInternalServerError
if he, ok := err.(*echo.HTTPError); ok {
code = he.Code
}
h.log.Error(err)
err = c.Render(code, "error.html", nil)
if err != nil {
h.log.Error(err)
}
}