all repos — homestead @ 7908475ecfeeb896d2283f9e2a2dd0c3ec820808

Code for my website

disable fiber startup message in production

Alan Pearce
commit

7908475ecfeeb896d2283f9e2a2dd0c3ec820808

parent

9e76a427bbc6545a4bc6bdc74518a802eca36b99

2 files changed, 6 insertions(+), 2 deletions(-)

jump to
M internal/config/config.gointernal/config/config.go
@@ -36,6 +36,7 @@ DefaultLanguage string `toml:"default_language"`
BaseURL URL `toml:"base_url"` RedirectOtherHostnames bool `toml:"redirect_other_hostnames"` Port uint64 + Production bool Title string Email string Description string
@@ -85,7 +86,8 @@ if err != nil {
return nil, err } config.Port = port - if os.Getenv("ENV") != "production" { + config.Production = os.Getenv("ENV") == "production" + if !config.Production { err = setDevelopmentOverrides(&config) if err != nil { return nil, errors.WithMessage(err, "could not override configuration")
M server.goserver.go
@@ -117,7 +117,9 @@ }))
website.Use(notFoundHandler) hosts[config.BaseURL.Host] = &Host{website} - toplevel := fiber.New() + toplevel := fiber.New(fiber.Config{ + DisableStartupMessage: config.Production, + }) toplevel.Get("/health", func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) })