Finish config mapping

This commit is contained in:
Ben Sarmiento
2023-10-19 18:02:30 +02:00
parent ce0b2445b2
commit faba4e53ab
14 changed files with 397 additions and 89 deletions

View File

@@ -3,18 +3,26 @@ package main
import (
"log"
"net/http"
"os"
"github.com/debridmediamanager.com/zurg/internal/config"
"github.com/debridmediamanager.com/zurg/internal/dav"
"github.com/debridmediamanager.com/zurg/internal/torrent"
)
func main() {
mux := http.NewServeMux()
dav.Router(mux)
log.Println("Listening on port 8123...")
err := http.ListenAndServe(":8123", mux)
if err != nil {
log.Println(err)
c, cErr := config.LoadZurgConfig("./config.yml")
if cErr != nil {
log.Panicf("Config failed to load: %v", cErr)
}
t := torrent.NewTorrentManager(os.Getenv("RD_TOKEN"), c)
// app := aero.New()
// dav.Setup(app, c, t)
// app.Run()
mux := http.NewServeMux()
dav.Router(mux, c, t)
http.ListenAndServe(":8123", mux)
}