echo working

This commit is contained in:
2023-08-15 09:22:10 -03:00
parent 6ea0b14f33
commit c1360611d6
5 changed files with 74 additions and 37 deletions
+10
View File
@@ -0,0 +1,10 @@
package routes
import (
"github.com/labstack/echo/v4"
)
func SetupRoutes(server *echo.Echo) {
server.GET("/", GetVersion)
}
+20
View File
@@ -0,0 +1,20 @@
package routes
import (
"net/http"
"github.com/labstack/echo/v4"
)
func GetVersion(c echo.Context) error {
type Version struct {
Version string `json:"version"`
}
v := Version{
Version: "1.0.0",
}
return c.JSON(http.StatusOK, v)
}