1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-29 22:56:37 -04:00

api: add COMMENTO_BIND_ADDRESS variable

Signed-off-by: Pierre-Alain TORET <pierre-alain.toret@protonmail.com>
This commit is contained in:
Pierre-Alain TORET
2018-06-09 23:19:19 +02:00
committed by daftaupe
parent 684734cb29
commit 73d04bf857
3 changed files with 22 additions and 2 deletions

View File

@ -14,6 +14,23 @@ func TestParseConfigBasics(t *testing.T) {
return
}
if os.Getenv("BIND_ADDRESS") != "127.0.0.1" {
t.Errorf("expected BIND_ADDRESS=127.0.0.1, but BIND_ADDRESS=%s instead", os.Getenv("BIND_ADDRESS"))
return
}
os.Setenv("COMMENTO_BIND_ADDRESS", "192.168.1.100")
if err := parseConfig(); err != nil {
t.Errorf("unexpected error when parsing config: %v", err)
return
}
if os.Getenv("BIND_ADDRESS") != "192.168.1.100" {
t.Errorf("expected BIND_ADDRESS=192.168.1.100, but BIND_ADDRESS=%s instead", os.Getenv("BIND_ADDRESS"))
return
}
// This test feels kinda stupid, but whatever.
if os.Getenv("PORT") != "8080" {
t.Errorf("expected PORT=8080, but PORT=%s instead", os.Getenv("PORT"))