2 files changed,
3 insertions(+),
1 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-01-13 20:13:44 +0200
Change ID:
smynttrywrqqluvrtvsltrywqomvmnum
Parent:
7eea7ff
M
api.go
@@ -125,6 +125,7 @@ }
func makeRequest[T any](apiKey, endpoint string, args ...any) (*T, error) { url := fmt.Sprintf("https://api.themoviedb.org/3"+endpoint+"?api_key=%s", append(args, apiKey)...) + slog.Info("external API request", "endpoint", fmt.Sprintf(endpoint, args...)) resp, err := http.Get(url) if err != nil { return nil, fmt.Errorf("failed to fetch %s: %w", endpoint, err)
M
main.go
@@ -24,6 +24,7 @@ os.Exit(1)
} http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + slog.Info("incoming request", "method", r.Method, "url", r.URL.String()) episodes, err := fetchNewEpisodes(config) if err != nil { slog.Error("failed to fetch episodes", "err", err)@@ -33,7 +34,7 @@ }
rssFeed := generateRSS(episodes) w.Header().Set("Content-Type", "application/rss+xml") - w.Write([]byte(rssFeed)) + _, _ = w.Write([]byte(rssFeed)) }) addr := ":" + config.Port