Expose discovery cache over rest interface
This commit is contained in:
@@ -49,6 +49,7 @@ func startGUI(cfg GUIConfiguration, m *Model) error {
|
||||
router.Get("/rest/config/sync", restGetConfigInSync)
|
||||
router.Get("/rest/system", restGetSystem)
|
||||
router.Get("/rest/errors", restGetErrors)
|
||||
router.Get("/rest/discovery", restGetDiscovery)
|
||||
|
||||
router.Post("/rest/config", restPostConfig)
|
||||
router.Post("/rest/restart", restPostRestart)
|
||||
@@ -243,6 +244,10 @@ func restPostDiscoveryHint(r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
func restGetDiscovery(w http.ResponseWriter) {
|
||||
json.NewEncoder(w).Encode(discoverer.All())
|
||||
}
|
||||
|
||||
func basic(username string, passhash string) http.HandlerFunc {
|
||||
return func(res http.ResponseWriter, req *http.Request) {
|
||||
error := func() {
|
||||
|
||||
Reference in New Issue
Block a user