diff options
| author | Horus3 | 2015-05-09 01:57:32 +0200 |
|---|---|---|
| committer | Horus3 | 2015-05-09 01:57:32 +0200 |
| commit | 9c757388f1974b32a2f88cf36b709a160491baf8 (patch) | |
| tree | 5111934ab42db0f1beafd16ffea5fb04d9350478 /main.go | |
| parent | 5def3f17f1809eb3727efd21d4b482452620342b (diff) | |
| download | uhttpd-9c757388f1974b32a2f88cf36b709a160491baf8.tar.gz | |
Show pretty html pages.
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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) { |
