mirror of
https://git.freecumextremist.com/grumbulon/pomme.git
synced 2024-12-22 18:00:44 +00:00
added sample config
This commit is contained in:
parent
55383869d1
commit
200997976d
2 changed files with 5 additions and 3 deletions
3
config.sample.yaml
Normal file
3
config.sample.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
server: example.com # does nothing yet
|
||||
hashingsecret: PasswordHashingSecret
|
||||
port: 3008 # port the server runs on
|
|
@ -59,20 +59,19 @@ func ReadConfig() (*Config, error) {
|
|||
|
||||
if data, err = os.ReadFile(filepath.Clean(defaultConfigPath)); err == nil {
|
||||
if err = yaml.Unmarshal(data, &config); err != nil {
|
||||
|
||||
return &Config{}, fmt.Errorf("unable to unmarshal config file: %w", err)
|
||||
}
|
||||
|
||||
return &config, nil
|
||||
}
|
||||
|
||||
if data, err = os.ReadFile(filepath.Clean("./config.yaml")); err == nil {
|
||||
if err = yaml.Unmarshal(data, &config); err != nil {
|
||||
|
||||
return &Config{}, fmt.Errorf("unable to unmarshal config file: %w", err)
|
||||
}
|
||||
|
||||
return &config, nil
|
||||
}
|
||||
|
||||
return &Config{}, fmt.Errorf("unable to read config file: %w", err)
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue