initial version with fiber and gorm
This commit is contained in:
@@ -5,4 +5,5 @@ import "github.com/gofiber/fiber/v2"
|
||||
func Setup(app *fiber.App) {
|
||||
|
||||
app.Get("/", GetVersion)
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"api/globals"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
@@ -8,10 +10,12 @@ func GetVersion(c *fiber.Ctx) error {
|
||||
|
||||
type Version struct {
|
||||
Version string `json:"version"`
|
||||
Release string `json:"release"`
|
||||
}
|
||||
|
||||
v := Version{
|
||||
Version: "1.0.0",
|
||||
Version: globals.API_VERSION,
|
||||
Release: globals.API_RELEASE,
|
||||
}
|
||||
|
||||
return c.JSON(v)
|
||||
|
||||
Reference in New Issue
Block a user