init(web): add quotes page

This commit is contained in:
2025-01-07 02:58:04 +03:00
parent 02b848a737
commit bddcd49d2a
7 changed files with 240 additions and 1 deletions
+10 -1
View File
@@ -9,8 +9,17 @@ import (
func root(c *gin.Context) {
authorized := c.GetBool("authorized")
if authorized {
c.HTML(http.StatusOK, "quotes.html", nil)
c.Redirect(http.StatusSeeOther, "/quotes")
} else {
c.HTML(http.StatusOK, "auth.html", nil)
}
}
func quotes(c *gin.Context) {
authorized := c.GetBool("authorized")
if authorized {
c.HTML(http.StatusOK, "quotes.html", nil)
} else {
c.Redirect(http.StatusSeeOther, "/")
}
}
+1
View File
@@ -20,6 +20,7 @@ func Serve(addr string) {
r.Static("/static", "./static")
r.GET("/", api.MiddlewareAuth, root)
r.GET("/quotes", api.MiddlewareAuth, quotes)
r.Run(addr)
}