add gen web

This commit is contained in:
YouROK
2021-07-09 12:23:46 +03:00
parent 04ca2c5c82
commit c9ffcb1071
2 changed files with 118 additions and 5 deletions

View File

@@ -10,15 +10,11 @@ import (
)
func SetupRoute(route *gin.RouterGroup) {
route.GET("/", mainPage)
template.RouteWebPages(route)
route.GET("/stat", statPage)
route.GET("/magnets", getTorrents)
}
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)