You've already forked Go-Template
lint (#2)
All checks were successful
🧪 ✨ Unit Tests Workflow / 🔍 🐹 Go Tests (push) Successful in 1m5s
All checks were successful
🧪 ✨ Unit Tests Workflow / 🔍 🐹 Go Tests (push) Successful in 1m5s
Reviewed-on: Siteworxpro/Go-Template#2 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
This commit was merged in pull request #2.
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"gitea.siteworxpro.com/Siteworxpro/Go-Template/http_handlers/errors"
|
||||
"gitea.siteworxpro.com/Siteworxpro/Go-Template/logger"
|
||||
"github.com/labstack/echo/v4"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func Register(g *echo.Group) {
|
||||
@@ -20,7 +21,7 @@ type index struct{}
|
||||
|
||||
func (i *index) Get(c echo.Context) error {
|
||||
c.Get("logger").(logger.Interface).Info("Index handler called")
|
||||
return c.JSON(200, map[string]string{"message": "Hello, World!"})
|
||||
return c.JSON(http.StatusOK, map[string]string{"message": "Hello, World!"})
|
||||
}
|
||||
|
||||
func (i *index) Post(c echo.Context) error {
|
||||
@@ -28,11 +29,11 @@ func (i *index) Post(c echo.Context) error {
|
||||
}
|
||||
|
||||
func (i *index) Put(c echo.Context) error {
|
||||
return c.JSON(200, map[string]string{"message": "Hello, World!"})
|
||||
return c.JSON(http.StatusOK, map[string]string{"message": "Hello, World!"})
|
||||
}
|
||||
|
||||
func (i *index) Delete(c echo.Context) error {
|
||||
return c.JSON(200, map[string]string{"message": "Hello, World!"})
|
||||
return c.JSON(http.StatusOK, map[string]string{"message": "Hello, World!"})
|
||||
}
|
||||
|
||||
func (i *index) Patch(c echo.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user