From d9fb844dc8f473b40a6eebc7034102a810f3e256 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 Former-commit-id: cb10c6fcbd1aa6bf92d06cd2d8665887f5c2018b [formerly b5c933531b7b50a9cc39d462c975f280fd500518] [formerly 3fedbc58ecf2e91794c22e48d667e53d0083a164 [formerly bc44aafffac795fe1186dc61dd8eca229dbd0581 [formerly 2be7c500a7ab38e2930de0ee185e2db30d11ec96]]] Former-commit-id: 9640ab56ba31f79aa603326ddf56aeee2bcbbfb0 [formerly 8a40c159a0eb7de236f7f4600e9678bef91d907c] Former-commit-id: f27fb19a55aa7e7c88886c47136826d917c1aeb0 Former-commit-id: b94c81da30c38fc97a554a4b252f025076f66393 --- 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") }