summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-05-12 22:08:55 -0300
committerJakob Borg <jakob@nym.se>2014-05-12 22:08:55 -0300
commit532b576fd59fd60d556f62bdbab70b3fbb6e54e0 (patch)
tree3c707f4d5af65e4e57fe295701cc46efe9dfe4f9 /cmd
parentdd1197236d3942232ec17bc4c3c0c4815603f387 (diff)
Expose discovery cache over rest interface
Diffstat (limited to 'cmd')
-rw-r--r--cmd/syncthing/gui.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go
index 83b2fe32c8..d88478bcdb 100644
--- a/cmd/syncthing/gui.go
+++ b/cmd/syncthing/gui.go
@@ -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() {