You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
503 B
25 lines
503 B
package main |
|
|
|
import ( |
|
"net/http" |
|
|
|
"github.com/gin-gonic/gin" |
|
) |
|
|
|
func showIndexPage(c *gin.Context) { |
|
reminders := getAllReminds() |
|
|
|
// Вызовем метод HTML из Контекста Gin для обработки шаблона |
|
c.HTML( |
|
// Зададим HTTP статус 200 (OK) |
|
http.StatusOK, |
|
// Используем шаблон index.html |
|
"index.html", |
|
// Передадим данные в шаблон |
|
gin.H{ |
|
"title": "Home Page", |
|
"payload": reminders, |
|
}, |
|
) |
|
|
|
}
|
|
|