Skip to content

Commit feecd9d

Browse files
committed
added new EVN VARIABLES which can be used to set custom data, which can then be accessed by {{ .Key }}
1 parent fdb0867 commit feecd9d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func main() {
3737
signalUrl := os.Getenv("SIGNAL_API_URL")
3838

3939
blockedEndpointJSON := os.Getenv("BLOCKED_ENDPOINTS")
40+
variablesJSON := os.Getenv("VARIABLES")
4041

4142
log.Info("Loaded Environment Variables")
4243

@@ -52,6 +53,18 @@ func main() {
5253
BLOCKED_ENDPOINTS = blockedEndpoints
5354
}
5455

56+
if variablesJSON != "" {
57+
var variables map[string]string
58+
59+
err := json.Unmarshal([]byte(variablesJSON), &variables)
60+
61+
if err != nil {
62+
log.Error("Could not decode Variables ", variablesJSON)
63+
}
64+
65+
VARIABLES = variables
66+
}
67+
5568
handler = proxy.Create(signalUrl)
5669

5770
finalHandler := proxy.AuthMiddleware(

0 commit comments

Comments
 (0)