Remove .html

This commit is contained in:
Jan Bader 2016-12-07 16:59:04 +01:00
parent ed0b939a75
commit f74b7ab078

View File

@ -12,12 +12,12 @@ func main() {
router.LoadHTMLGlob("./templates/*")
router.Static("/static", "./static")
router.GET("/login.html", login)
router.GET("/login", login)
api := router.Group("/api/v1")
{
api.GET("/logout", logout)
api.GET("/login", func(c *gin.Context) {
c.Redirect(http.StatusPermanentRedirect, "/login.html")
c.Redirect(http.StatusPermanentRedirect, "/login")
})
api.POST("/login", loginPost)
@ -37,14 +37,13 @@ func main() {
}
}
router.Run(":1323")
}
func restricted(c *gin.Context) {
claims, ok := verifyLogin(c)
if !ok {
c.Redirect(http.StatusTemporaryRedirect, "/login.html")
c.Redirect(http.StatusTemporaryRedirect, "/login")
return
}