statping/handlers/function.go

36 lines
610 B
Go
Raw Normal View History

package handlers
import (
"github.com/hunterlong/statping/core"
"html/template"
"net/http"
)
2020-01-13 07:11:53 +00:00
var (
basePath = "/"
)
var handlerFuncs = func(w http.ResponseWriter, r *http.Request) template.FuncMap {
return template.FuncMap{
"VERSION": func() string {
return core.VERSION
},
2020-02-19 08:13:09 +00:00
"CoreApp": func() core.Core {
c := *core.CoreApp
if c.Name == "" {
c.Name = "Statping"
}
return c
},
"USE_CDN": func() bool {
return core.CoreApp.UseCdn.Bool
},
2020-02-20 05:28:39 +00:00
"USING_ASSETS": func() bool {
return core.CoreApp.UsingAssets()
},
2020-01-13 07:11:53 +00:00
"BasePath": func() string {
return basePath
},
}
}