From 2be7c500a7ab38e2930de0ee185e2db30d11ec96 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 6 Feb 2016 21:58:32 -0500 Subject: [PATCH] Adding new route for viewing --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 91bbdc0..1648c29 100755 --- a/main.go +++ b/main.go @@ -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") }