mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-05-16 06:53:03 +00:00
feat: get answer ID and fragment scrolling
This commit is contained in:
parent
6bfed5a9e3
commit
cc9e549aaf
4 changed files with 11 additions and 1 deletions
4
main.go
4
main.go
|
@ -55,6 +55,10 @@ func main() {
|
|||
c.Redirect(302, fmt.Sprintf("/questions/%s/placeholder", c.Param("id")))
|
||||
})
|
||||
r.GET("/questions/:id/:title", routes.ViewQuestion)
|
||||
r.GET("/questions/:id/:title/:answerId", func(c *gin.Context) {
|
||||
// redirect user to the answer with the title
|
||||
c.Redirect(302, fmt.Sprintf("/questions/%s/%s#%s", c.Param("id"), c.Param("title"), c.Param("answerId")))
|
||||
})
|
||||
|
||||
r.GET("/proxy", routes.GetImage)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue