Данные от ластфм вынесены в конфиг

design
serr 2025-05-18 14:11:59 +03:00
parent 4e2f70668d
commit b28d08f95e
2 changed files with 13 additions and 11 deletions

View File

@ -12,7 +12,7 @@ func LastfmHandler(app *models.App) http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var err error
resp, err := models.GetRecentTracks("s3rr", "bc5ce9ff9289ac925841cf483e211fc1")
resp, err := models.GetRecentTracks(app.Cfg.LastfmUsername, app.Cfg.LastfmToken)
if err != nil {
log.Println(err)
}

View File

@ -20,6 +20,8 @@ type Config struct {
ServerPort string
ServerDomain string
Port string
LastfmUsername string
LastfmToken string
}
func loadConfig(configPath string) (*Config, error) {