package controllers import ( "fmt" "main/mvc/models" "net/http" ) // Обработчик главной страницы func LastFMHandler(app *models.App) http.HandlerFunc { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { sendLastFM(w, app.LastfmLastTrack) }) } // Отправляет страницу func sendLastFM(w http.ResponseWriter, data string) { w.Header().Set("Content-Type", "text/html; charset=utf-8") w.WriteHeader(http.StatusOK) fmt.Fprint(w, data) }