Данные от ластфм вынесены в конфиг
parent
4e2f70668d
commit
b28d08f95e
|
@ -12,7 +12,7 @@ func LastfmHandler(app *models.App) http.HandlerFunc {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
resp, err := models.GetRecentTracks("s3rr", "bc5ce9ff9289ac925841cf483e211fc1")
|
resp, err := models.GetRecentTracks(app.Cfg.LastfmUsername, app.Cfg.LastfmToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ type Config struct {
|
||||||
ServerPort string
|
ServerPort string
|
||||||
ServerDomain string
|
ServerDomain string
|
||||||
Port string
|
Port string
|
||||||
|
LastfmUsername string
|
||||||
|
LastfmToken string
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadConfig(configPath string) (*Config, error) {
|
func loadConfig(configPath string) (*Config, error) {
|
||||||
|
|
Loading…
Reference in New Issue