skazanull/web/server/handlers.go
2025-01-07 04:32:49 +03:00

21 lines
330 B
Go

package server
import (
"net/http"
"github.com/gin-gonic/gin"
)
func root(c *gin.Context) {
user_id := c.GetString("user_id")
if user_id != "" {
c.Redirect(http.StatusSeeOther, "/quotes")
} else {
c.HTML(http.StatusOK, "auth.html", nil)
}
}
func quotes(c *gin.Context) {
c.HTML(http.StatusOK, "quotes.html", nil)
}