mirror of
https://github.com/cubixle/tuukoti-cli.git
synced 2026-04-30 16:28:44 +01:00
add cmd dir and move templates over
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user