Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Make GIN_MODE load properly when initializing deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dottorblaster committed Oct 4, 2021
1 parent bfba591 commit b7e8089
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/app.go
Expand Up @@ -4,6 +4,7 @@ import (
"embed"
"fmt"
"net/http"
"os"
"time"

"github.com/gin-contrib/sessions"
Expand Down Expand Up @@ -48,13 +49,16 @@ func DefaultDependencies() Dependencies {
consulClient, _ := consul.DefaultClient()
engine := gin.Default()
store := cookie.NewStore([]byte("secret"))
mode := os.Getenv(gin.EnvGinMode)

araService := ara.NewAraService(araAddrDefault)
checksService := services.NewChecksService(araService)
subscriptionsService := services.NewSubscriptionsService(consulClient)
hostsService := services.NewHostsService(consulClient)
sapSystemsService := services.NewSAPSystemsService(consulClient)

gin.SetMode(mode)

return Dependencies{
consulClient, engine, store, checksService,
subscriptionsService, hostsService, sapSystemsService}
Expand Down

0 comments on commit b7e8089

Please sign in to comment.