21 lines
407 B
Go
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,
|
|
})
|
|
}
|