diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-03-30 15:57:16 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-03-30 15:57:16 +0200 |
commit | 4b66cdadf8420953c35799b4462d6045351ed038 (patch) | |
tree | 7b49c9dce6946adb3d7b07aa1df7f5d6dd033539 /route.go | |
parent | 7355b100f7419e74a46b5bf1465c8dbcb06bee7d (diff) |
Add /debug/route
Diffstat (limited to 'route.go')
-rw-r--r-- | route.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |