From 9c757388f1974b32a2f88cf36b709a160491baf8 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sat, 9 May 2015 01:57:32 +0200 Subject: Show pretty html pages. --- main.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 36781f2..9ec7157 100644 --- a/main.go +++ b/main.go @@ -11,11 +11,20 @@ import ( ) func accessLog(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + t := &TemplateHandler{handler: h} + //t := &TemplateHandler{} + fn := func(w http.ResponseWriter, r *http.Request) { log.Println(r.Method, r.URL.Path, r.RemoteAddr) - h.ServeHTTP(w, r) - }) + t.ServeHTTP(w, r) + } + return http.HandlerFunc(fn) +} + +/* +func TemplateHandler(h http.Handler) http.Handler { + h.handler } +*/ func uploadHandler(dir string) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { -- cgit v1.2.3