love method added

master
serr 2025-04-06 16:14:17 +03:00
parent 65a4a420a6
commit d984c6fd1f
1 changed files with 13 additions and 0 deletions

View File

@ -24,6 +24,12 @@ func MainPageHandler(a *models.App) http.HandlerFunc {
return
}
// Пасхалка
if r.Method == "LOVE" {
SendLove(w)
return
}
// Страничка рендерится только если ее нет в кэше
pageData, ok := a.Cache.Get(models_pages.MainPageTmplName)
if !ok {
@ -52,3 +58,10 @@ func SendCount(w http.ResponseWriter, data []byte) {
w.WriteHeader(http.StatusOK)
w.Write(data)
}
// Ответ на метод LOVE
func SendLove(w http.ResponseWriter) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusOK)
w.Write([]byte("13.01.2005"))
}