aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 18:36:06 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 18:36:06 +0200
commit49766901293631aeabfc96e8d80aba305f420630 (patch)
tree56ada5226ac5d47a8277de00022190ab946490a1 /main.go
parent1168ac60d3a22c0d354f291fd657ad302df6ec05 (diff)
feat(backend): config to set domain
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.go b/main.go
index e1c13bb..abab2ea 100644
--- a/main.go
+++ b/main.go
@@ -56,7 +56,13 @@ func init() {
func main() {
flag.Parse()
- r := backend.NewRouter(dev)
+ cfg, ok := backend.LoadConfig(configFile)
+ if !ok {
+ slog.Info("exiting")
+ os.Exit(1)
+ }
+
+ r := backend.NewRouter(dev, cfg)
backend.HandleHome(r)
@@ -72,7 +78,7 @@ func main() {
sc := make(chan os.Signal, 1)
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
- ok := true
+ ok = true
for ok {
select {
case err := <-errChan: