mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-06-26 02:51:04 +00:00
feat: redirect questions without title in URL
This commit is contained in:
parent
bd48b309ac
commit
2b608b4725
1 changed files with 4 additions and 1 deletions
5
main.go
5
main.go
|
@ -47,9 +47,12 @@ func main() {
|
|||
r.GET("/options/:name", routes.ChangeOptions)
|
||||
|
||||
r.GET("/", routes.GetHome)
|
||||
|
||||
r.POST("/", routes.PostHome)
|
||||
|
||||
r.GET("/questions/:id", func(c *gin.Context) {
|
||||
// redirect user to the question with the title
|
||||
c.Redirect(302, fmt.Sprintf("/questions/%s/placeholder", c.Param("id")))
|
||||
})
|
||||
r.GET("/questions/:id/:title", routes.ViewQuestion)
|
||||
|
||||
r.GET("/proxy", routes.GetImage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue