Skip to content

Commit

Permalink
feat: Add env COLOR for font color configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed Jan 5, 2022
1 parent 96d6481 commit acd8313
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

var Counter = 0
var Color = "black"
var BackgroundColor = "white"
var RunTimestamp time.Time

Expand All @@ -37,6 +38,7 @@ func indexHTML(w http.ResponseWriter, hostname string) {
fmt.Fprint(w, `<style>
html, body {
height: 100%;
color: `+Color+`;
background-color: `+BackgroundColor+`
}
.center-parent {
Expand Down Expand Up @@ -137,6 +139,11 @@ func main() {
BackgroundColor = backgroundCounterEnv
}

counterEnv := os.Getenv("COLOR")
if counterEnv != "" {
Color = counterEnv
}

RunTimestamp = time.Now()
http.HandleFunc("/", index)
http.HandleFunc("/api/version", versionAPI)
Expand Down

0 comments on commit acd8313

Please sign in to comment.