mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
refactor and to go mod
This commit is contained in:
21
server/web/pages/route.go
Normal file
21
server/web/pages/route.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"server/torr"
|
||||
"server/web/pages/template"
|
||||
)
|
||||
|
||||
func SetupRoute(route *gin.Engine) {
|
||||
route.GET("/", mainPage)
|
||||
route.GET("/stat", statPage)
|
||||
}
|
||||
|
||||
func mainPage(c *gin.Context) {
|
||||
c.Data(200, "text/html; charset=utf-8", template.IndexHtml)
|
||||
}
|
||||
|
||||
func statPage(c *gin.Context) {
|
||||
torr.WriteStatus(c.Writer)
|
||||
c.Status(200)
|
||||
}
|
||||
Reference in New Issue
Block a user