@@ 27,6 27,7 @@ type Config struct {
EmailAdminErrors bool
DefaultFromEmail string
DefaultLang string
+ Environment string
Scheme string
Domain string
@@ 58,6 59,7 @@ func LoadConfig(fname string) (*Config, error) {
EmailAdminErrors: true,
DefaultFromEmail: "gobwebs@localhost",
DefaultLang: "en",
+ Environment: "development",
Scheme: "http",
Domain: "127.0.0.1:8000",
}
@@ 133,6 135,10 @@ func LoadConfig(fname string) (*Config, error) {
conf.Domain = val
}
+ if val, ok := file.Get("gobwebs", "environment"); ok {
+ conf.Environment = val
+ }
+
conf.DbConnString, ok = file.Get("database", "connection-string")
if !ok {
return nil, fmt.Errorf("database:connection-string unset")