add configurable name
All checks were successful
Release / publish (push) Successful in 5m27s

This commit is contained in:
2025-07-08 11:57:16 +02:00
parent 30dac9f12f
commit 68574ad289
12 changed files with 461 additions and 31 deletions

View File

@@ -12,6 +12,11 @@ type Config struct {
Host string `env:"HOST"`
DBPath string `env:"DB_PATH"`
Auth auth.Config `env:"AUTH"`
Web Web `env:"WEB"`
}
type Web struct {
Name string `env:"NAME" json:"name"`
}
// Default returns a default configuration with pre-defined values.
@@ -26,5 +31,8 @@ func Default() *Config {
AdminName: "admin",
AdminPassword: "admin",
},
Web: Web{
Name: "ng-blog",
},
}
}

View File

@@ -0,0 +1,10 @@
package config
import (
"encoding/json"
"net/http"
)
func (c *Config) Handle(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(c.Web)
}