read db connection details from envvar

parent 5b28c83f
Pipeline #10470 passed with stages
in 7 minutes and 25 seconds
......@@ -3,6 +3,7 @@ package main
import (
"github.com/BurntSushi/toml"
"log"
"os"
"time"
)
......@@ -67,5 +68,9 @@ func LoadConfig(filepath string) Config {
if err != nil {
log.Fatalln("Error on loading config: ", err)
}
dsn := os.Getenv("DSN")
if dsn != "" {
conf.DB.Dsn = dsn
}
return conf
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment