Skip to content

Commit

Permalink
updated rest http/https config names and rest app config path
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Dias committed Oct 24, 2024
1 parent a698e11 commit f4327f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (sc *restServerCreator) Accept(config *Bag) bool {
if e := config.Populate("", &sc.config); e != nil {
return false
}
return strings.ToLower(sc.config.Type) == "default" &&
return strings.ToLower(sc.config.Type) == "http" &&
sc.config.WatchdogID != "" &&
sc.config.Port != 0
}
Expand Down Expand Up @@ -346,7 +346,7 @@ func (sc *restServerTLSCreator) Accept(config *Bag) bool {
if e := config.Populate("", &sc.config); e != nil {
return false
}
return strings.ToLower(sc.config.Type) == "tls" &&
return strings.ToLower(sc.config.Type) == "https" &&
sc.config.WatchdogID != "" &&
sc.config.Port != 0 &&
sc.config.TLS.Cert != "" &&
Expand Down
9 changes: 7 additions & 2 deletions rest_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
"go.uber.org/dig"
)

var (
RestIndexConfigPath = "flam.app"
)

type restIndexGetResponse struct {
App string `json:"app"`
Version string `json:"version"`
Expand All @@ -18,9 +22,10 @@ type restIndexService struct {
}

func newRestIndexService(config Config) *restIndexService {
cfg := config.Bag(RestIndexConfigPath, &Bag{})
return &restIndexService{
app: config.String("app.name", ""),
version: config.String("app.version", ""),
app: cfg.String("name", ""),
version: cfg.String("version", ""),
}
}

Expand Down

0 comments on commit f4327f3

Please sign in to comment.