Adjust build process

This commit is contained in:
Florian Hoss 2023-07-05 11:05:51 +02:00
parent 99add9dbe2
commit f64d5c2420
8 changed files with 31 additions and 6 deletions

2
internal/env/env.go vendored
View file

@ -14,7 +14,7 @@ type Config struct {
TimeZone string `env:"TZ" envDefault:"Etc/UTC" validate:"timezone"`
Port int `env:"PORT" envDefault:"8080" validate:"min=1024,max=49151"`
LogLevel string `env:"LOG_LEVEL" envDefault:"info" validate:"oneof=debug info warn error panic fatal"`
Version string `env:"APP_VERSION" envDefault:"v0.0.0"`
Version string `env:"VERSION" envDefault:"v0.0.0"`
SwaggerHost string `env:"SWAGGER_HOST" envDefault:"https://cafe.test"`
DB_Host string `env:"DB_HOST"`
DB_User string `env:"DB_USER"`

View file

@ -75,13 +75,13 @@ func SetupRoutes(e *echo.Echo, ctrl *controller.Controller, env *env.Config) {
health := api.Group("/health", authHeader)
{
health.GET("", func(ctx echo.Context) error {
return ctx.String(http.StatusOK, ".")
return ctx.String(http.StatusOK, env.Version)
})
}
if env.SwaggerHost != "" {
docs.SwaggerInfo.Title = "Cafe"
docs.SwaggerInfo.Description = "This is the backend of a cafe"
docs.SwaggerInfo.Title = "Café Plätschwiesle"
docs.SwaggerInfo.Description = "This is the backend of Café Plätschwiesle"
docs.SwaggerInfo.Version = env.Version
docs.SwaggerInfo.BasePath = "/api"
parsed, _ := url.Parse(env.SwaggerHost)