Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/controllers/torrent/router.go

30 lignes
928 B
Go

package torrentController
import (
"github.com/NyaaPantsu/nyaa/controllers/middlewares"
"github.com/NyaaPantsu/nyaa/controllers/router"
)
func init() {
router.Get().Any("/download/:hash", DownloadTorrent)
router.Get().Any("/stats/:id", GetStatsHandler)
router.Get().Any("/files/:id", GetFilesHandler)
torrentRoutes := router.Get().Group("/torrent", middlewares.LoggedInMiddleware())
{
torrentRoutes.GET("/", TorrentEditUserPanel)
torrentRoutes.POST("/", TorrentPostEditUserPanel)
torrentRoutes.GET("/tag", ViewFormTag)
torrentRoutes.POST("/tag", ViewFormTag)
torrentRoutes.GET("/tag/add", AddTag)
torrentRoutes.GET("/tag/remove", DeleteTag)
torrentRoutes.POST("/delete", TorrentDeleteUserPanel)
}
torrentViewRoutes := router.Get().Group("/view")
{
torrentViewRoutes.GET("/:id", ViewHandler)
torrentViewRoutes.HEAD("/:id", ViewHeadHandler)
torrentViewRoutes.POST("/:id", PostCommentHandler)
}
}