fiber initial version
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user