From bacb607d902cd125c1e97d56d4b51ad56474cc54 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Sun, 3 Nov 2024 04:46:24 +0000 Subject: [PATCH] Allow using env variables in custom API URL --- internal/widget/custom-api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/widget/custom-api.go b/internal/widget/custom-api.go index df45940..a7a69dd 100644 --- a/internal/widget/custom-api.go +++ b/internal/widget/custom-api.go @@ -14,7 +14,7 @@ import ( type CustomApi struct { widgetBase `yaml:",inline"` - URL string `yaml:"url"` + URL OptionalEnvString `yaml:"url"` Template string `yaml:"template"` Frameless bool `yaml:"frameless"` Headers map[string]OptionalEnvString `yaml:"headers"` @@ -42,7 +42,7 @@ func (widget *CustomApi) Initialize() error { widget.compiledTemplate = compiledTemplate - req, err := http.NewRequest(http.MethodGet, widget.URL, nil) + req, err := http.NewRequest(http.MethodGet, widget.URL.String(), nil) if err != nil { return err }