Files
kontor/kontor-gin/pkg/controllers/handlers.go
T
Thomas Peetz f2f4a0aaf6
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
add templates for kontor-gin
2026-09-21 19:55:46 +02:00

21 lines
407 B
Go

package controllers
import (
"kontor-api-gin/pkg/globals"
"net/http"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
)
func IndexGetHandler(c *gin.Context) {
session := sessions.Default(c)
user := session.Get(globals.UserKey)
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
"content": "This is an index page...",
"user": user,
})
}