Open platform to collect and prioritize feedback
add version
goenning9d706e7b518f
diff --git a/app/handler.go b/app/handler.goindex 7afca4f18..7dee5280f 100644--- a/app/handler.go+++ b/app/handler.go@@ -21,7 +21,8 @@ func Status(healthService HealthCheckService, settings *WechySettings) echo.Handfunc (h statusHandler) get() echo.HandlerFunc {return func(c echo.Context) error {return c.JSON(http.StatusOK, echo.Map{- "build": h.settings.BuildTime,+ "build": h.settings.BuildTime,+ "vresion": h.settings.Version,"healthy": echo.Map{"database": h.healthService.IsDatabaseOnline(),},diff --git a/app/router.go b/app/router.goindex f95d3077f..21f66ddd2 100644--- a/app/router.go+++ b/app/router.go@@ -15,6 +15,7 @@ import (// WechySettings is an application-wide settingstype WechySettings struct {BuildTime string+ Version stringAuthEndpoint string}@@ -77,9 +78,9 @@ func GetMainEngine(ctx *WechyServices) *echo.Echo {appGroup.Use(identity.MultiTenant(ctx.Tenant))appGroup.GET("/", feedback.Index(ctx.Idea).List())- appGroup.POST("/api/ideas", feedback.Index(ctx.Idea).Post())appGroup.GET("/logout", identity.OAuth(ctx.OAuth, ctx.User).Logout())- appGroup.GET("/status", Status(ctx.Health, ctx.Settings))+ appGroup.POST("/api/ideas", feedback.Index(ctx.Idea).Post())+ appGroup.GET("/api/status", Status(ctx.Health, ctx.Settings))}return routerdiff --git a/main.go b/main.goindex dbaef096f..fa0499266 100644--- a/main.go+++ b/main.go@@ -15,6 +15,7 @@ import ()var buildtime string+var version = "0.0.0"func migrate() {if env.IsTest() {@@ -22,6 +23,7 @@ func migrate() {}fmt.Printf("Running migrations... \n")+ fmt.Println(env.MustGet("DATABASE_URL"))errors, ok := mig.UpSync(env.MustGet("DATABASE_URL"), "./migrations")if !ok {for i, err := range errors {@@ -53,6 +55,7 @@ func main() {Tenant: &postgres.TenantService{DB: db},Settings: &app.WechySettings{BuildTime: buildtime,+ Version: version,AuthEndpoint: env.MustGet("AUTH_ENDPOINT"),},}