init(web): add quotes page
This commit is contained in:
+10
-1
@@ -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, "/")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user