refactor and to go mod

This commit is contained in:
YouROK
2021-02-18 16:56:55 +03:00
parent 0e49a98626
commit 94f212fa75
50 changed files with 13 additions and 29 deletions

21
server/web/pages/route.go Normal file
View 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)
}