Redo router and use chi, implement anchor file

This commit is contained in:
Ben Sarmiento
2024-01-08 21:13:35 +01:00
parent 122eea2374
commit 96e41d6cbc
11 changed files with 352 additions and 295 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/debridmediamanager/zurg/internal/config"
"github.com/debridmediamanager/zurg/internal/torrent"
"github.com/debridmediamanager/zurg/internal/version"
)
func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
@@ -27,6 +28,7 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
if torMgr.Config.GetConfig().UseDownloadCache {
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s/\">%s</a></li>", config.DOWNLOADS, config.DOWNLOADS))
}
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s\">%s</a></li>", version.FILE, version.FILE))
return buf.Bytes(), nil
}