love method added
parent
65a4a420a6
commit
d984c6fd1f
|
@ -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"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue