tstor/http/web.go
Antonio Navarro Perez 0e2288565d
Reload server and edit configuration. (#15)
The first iteration for config editor and server reload from the web interface.
2020-11-08 18:19:25 +01:00

22 lines
440 B
Go

package http
import (
"net/http"
"github.com/ajnavarro/distribyted/stats"
"github.com/gin-gonic/gin"
)
var indexHandler = func(c *gin.Context) {
c.HTML(http.StatusOK, "index.html", nil)
}
var routesHandler = func(ss *stats.Torrent) gin.HandlerFunc {
return func(c *gin.Context) {
c.HTML(http.StatusOK, "routes.html", ss.RoutesStats())
}
}
var configHandler = func(c *gin.Context) {
c.HTML(http.StatusOK, "config.html", nil)
}