echo working
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func SetupRoutes(server *echo.Echo) {
|
||||
|
||||
server.GET("/", GetVersion)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user