1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Adding new route for viewing

This commit is contained in:
Zack Scholl 2016-02-06 21:58:32 -05:00
parent 107e20c283
commit 2be7c500a7

View File

@ -135,6 +135,15 @@ func main() {
}
})
r.GET("/:title/*option", func(c *gin.Context) {
title := c.Param("title")
option := c.Param("option")
fmt.Println(title, "["+option+"]")
if option == "/view" {
} else {
c.Redirect(302, "/"+title)
}
})
r.Run(":12312")
}