aboutsummaryrefslogtreecommitdiff
path: root/route.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-30 15:57:16 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-03-30 15:57:16 +0200
commit4b66cdadf8420953c35799b4462d6045351ed038 (patch)
tree7b49c9dce6946adb3d7b07aa1df7f5d6dd033539 /route.go
parent7355b100f7419e74a46b5bf1465c8dbcb06bee7d (diff)
Add /debug/route
Diffstat (limited to 'route.go')
-rw-r--r--route.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/route.go b/route.go
index 93a18d3..544fd2f 100644
--- a/route.go
+++ b/route.go
@@ -4,6 +4,8 @@ import (
"crypto/tls"
"encoding/json"
"errors"
+ "fmt"
+ "net/http"
"os"
)
@@ -38,6 +40,12 @@ func (r *Route) Load(fname string) error {
return json.NewDecoder(fd).Decode(r)
}
+func (r Route) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
+ for k, v := range r {
+ fmt.Fprintln(w, k, v)
+ }
+}
+
// Entry holds routing settings
type Entry struct {
Host string // HostName