Данные от ластфм вынесены в конфиг
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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,18 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
PostsDir string
|
PostsDir string
|
||||||
AssetsDir string
|
AssetsDir string
|
||||||
TemplatesDir string
|
TemplatesDir string
|
||||||
TemplatesExt string
|
TemplatesExt string
|
||||||
LocalIP string
|
LocalIP string
|
||||||
LocalPort string
|
LocalPort string
|
||||||
ServerIP string
|
ServerIP string
|
||||||
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