fiber initial version

This commit is contained in:
2023-08-15 09:31:18 -03:00
parent c1360611d6
commit e44e08aab5
5 changed files with 50 additions and 17 deletions
+3 -5
View File
@@ -1,10 +1,8 @@
package routes
import (
"github.com/labstack/echo/v4"
)
import "github.com/gofiber/fiber/v2"
func SetupRoutes(server *echo.Echo) {
func Setup(app *fiber.App) {
server.GET("/", GetVersion)
app.Get("/", GetVersion)
}
+3 -5
View File
@@ -1,12 +1,10 @@
package routes
import (
"net/http"
"github.com/labstack/echo/v4"
"github.com/gofiber/fiber/v2"
)
func GetVersion(c echo.Context) error {
func GetVersion(c *fiber.Ctx) error {
type Version struct {
Version string `json:"version"`
@@ -16,5 +14,5 @@ func GetVersion(c echo.Context) error {
Version: "1.0.0",
}
return c.JSON(http.StatusOK, v)
return c.JSON(v)
}