mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2024-12-06 19:16:43 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 81c4568564 | |||
| 9d77743865 | |||
| 5ec826a160 | |||
| 596ffaa02a |
@@ -38,7 +38,6 @@ This project is super lightweight by design. The UI is simple and the frontend i
|
|||||||
| [exchange.seitan-ayoub.lol](https://exchange.seitan-ayoub.lol) | Germany | Operated by [Seitan Ayoub](https://seitan-ayoub.lol) |
|
| [exchange.seitan-ayoub.lol](https://exchange.seitan-ayoub.lol) | Germany | Operated by [Seitan Ayoub](https://seitan-ayoub.lol) |
|
||||||
| [overflow.r4fo.com](https://overflow.r4fo.com) | The Netherlands | Operated by [r4fo.com](https://r4fo.com) |
|
| [overflow.r4fo.com](https://overflow.r4fo.com) | The Netherlands | Operated by [r4fo.com](https://r4fo.com) |
|
||||||
| [overflow.ducks.party](https://overflow.ducks.party) | The Netherlands | Operated by [ducks.party](https://ducks.party) |
|
| [overflow.ducks.party](https://overflow.ducks.party) | The Netherlands | Operated by [ducks.party](https://ducks.party) |
|
||||||
| [ao.ngn.tf](https://ao.ngn.tf) | Turkey | Operated by [ngn](https://ngn.tf) |
|
|
||||||
|
|
||||||
## Other Instances
|
## Other Instances
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
var Version = "1.11.0"
|
var Version = "1.10.1"
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ func main() {
|
|||||||
|
|
||||||
r.GET("/a/:id", routes.RedirectShortenedOverflowURL)
|
r.GET("/a/:id", routes.RedirectShortenedOverflowURL)
|
||||||
r.GET("/q/:id", routes.RedirectShortenedOverflowURL)
|
r.GET("/q/:id", routes.RedirectShortenedOverflowURL)
|
||||||
r.GET("/q/:id/:answerId", routes.RedirectShortenedOverflowURL)
|
|
||||||
|
|
||||||
r.GET("/questions/:id", func(c *gin.Context) {
|
r.GET("/questions/:id", func(c *gin.Context) {
|
||||||
// redirect user to the question with the title
|
// redirect user to the question with the title
|
||||||
|
|||||||
@@ -50,15 +50,3 @@ html {
|
|||||||
details {
|
details {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.d-flex {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fd-column {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fw-nowrap {
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ func ViewQuestion(c *gin.Context) {
|
|||||||
"answers": answers,
|
"answers": answers,
|
||||||
"imagePolicy": imagePolicy,
|
"imagePolicy": imagePolicy,
|
||||||
"theme": c.MustGet("theme").(string),
|
"theme": c.MustGet("theme").(string),
|
||||||
"currentUrl": fmt.Sprintf("%s%s", os.Getenv("APP_URL"), c.Request.URL.Path),
|
"currentUrl": fmt.Sprintf("%s/questions/%s/%s", os.Getenv("APP_URL"), questionId, params.QuestionTitle),
|
||||||
"sortValue": params.SoSortValue,
|
"sortValue": params.SoSortValue,
|
||||||
"domain": domain,
|
"domain": domain,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
|
|
||||||
func RedirectShortenedOverflowURL(c *gin.Context) {
|
func RedirectShortenedOverflowURL(c *gin.Context) {
|
||||||
id := c.Param("id")
|
id := c.Param("id")
|
||||||
answerId := c.Param("answerId")
|
|
||||||
|
|
||||||
// fetch the stack overflow URL
|
// fetch the stack overflow URL
|
||||||
client := resty.New()
|
client := resty.New()
|
||||||
@@ -21,7 +20,7 @@ func RedirectShortenedOverflowURL(c *gin.Context) {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
resp, err := client.R().Get(fmt.Sprintf("https://www.stackoverflow.com/a/%s/%s", id, answerId))
|
resp, err := client.R().Get(fmt.Sprintf("https://www.stackoverflow.com/a/%s", id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.HTML(400, "home.html", gin.H{
|
c.HTML(400, "home.html", gin.H{
|
||||||
"errorMessage": "Unable to fetch stack overflow URL",
|
"errorMessage": "Unable to fetch stack overflow URL",
|
||||||
|
|||||||
Reference in New Issue
Block a user