mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-05-19 00:10:26 +00:00
Redirect-short-links (#50)
* feat: redirect shortened URLs * feat: accept shortened URLs in converter * fix: tell resty not to follow redirect * fix: remove log
This commit is contained in:
parent
4760681c55
commit
2ef7e05f4b
4 changed files with 53 additions and 3 deletions
2
main.go
2
main.go
|
@ -50,6 +50,8 @@ func main() {
|
|||
r.GET("/", routes.GetHome)
|
||||
r.POST("/", routes.PostHome)
|
||||
|
||||
r.GET("/a/:id", routes.RedirectShortenedOverflowURL)
|
||||
|
||||
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")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue