Support /t/TAG/ID paths (closes #117)
This commit is contained in:
parent
ea74f69c45
commit
c163ae690e
1
main.go
1
main.go
|
@ -118,6 +118,7 @@ func main() {
|
|||
app.Get("/a/:postID", pages.HandlePost)
|
||||
app.Get("/a/:postID/embed", pages.HandleEmbed)
|
||||
app.Get("/t/:tag", pages.HandleTag)
|
||||
app.Get("/t/:tag/:postID", pages.HandlePost)
|
||||
app.Get("/user/:userID", pages.HandleUser)
|
||||
app.Get("/r/:sub/:postID", pages.HandlePost)
|
||||
app.Get("/user/:userID/cover", pages.HandleUserCover)
|
||||
|
|
|
@ -20,6 +20,8 @@ func HandlePost(c *fiber.Ctx) error {
|
|||
post, err = ApiClient.FetchAlbum(c.Params("postID"))
|
||||
case strings.HasPrefix(c.Path(), "/gallery"):
|
||||
post, err = ApiClient.FetchPosts(c.Params("postID"))
|
||||
case strings.HasPrefix(c.Path(), "/t"):
|
||||
post, err = ApiClient.FetchPosts(c.Params("postID"))
|
||||
default:
|
||||
post, err = ApiClient.FetchMedia(c.Params("postID"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue