Skip to content

Commit 17ff4df

Browse files
committed
Polish envconfig mapping
1 parent de3bdbc commit 17ff4df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/conf/config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
// Pubstore configuration
12-
// split_words true is how envconfig maps e.g. the PUBFRONT_PUBLIC_BASE_URL environment variable to PublicBaseUrl
12+
// split_words true is how envconfig maps e.g. the PUBSTORE_PUBLIC_BASE_URL environment variable to PublicBaseUrl
1313
type Config struct {
1414
// Port on which the server is running
1515
Port int `yaml:"port"`
@@ -20,7 +20,7 @@ type Config struct {
2020
// OAuth seed
2121
OAuthSeed string `yaml:"oauth_seed" envconfig:"OAUTH_SEED"`
2222
// Path to static files and views
23-
RootDir string `yaml:"root_dir" envconfig:"ROOT_DIR"`
23+
RootDir string `yaml:"root_dir" split_words:"true"`
2424
// Path to resources, especially cover images
2525
Resources string `yaml:"resources"`
2626
// Page size used in the REST API and Web interface
@@ -47,6 +47,8 @@ func Init(configFile string) (Config, error) {
4747

4848
var cfg Config
4949

50+
log.Printf("Loading configuration from %s ...", configFile)
51+
5052
f, err := os.Open(configFile)
5153
if err != nil {
5254
log.Println("Configuration file not found")

0 commit comments

Comments
 (0)