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:
parent
107e20c283
commit
2be7c500a7
9
main.go
9
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")
|
r.Run(":12312")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user