merge eva repos into single repository

This commit is contained in:
gidsi 2018-04-20 18:08:55 +02:00
commit 200dd620ae
52 changed files with 2281 additions and 0 deletions

29
backend/logger.go Normal file
View file

@ -0,0 +1,29 @@
package main
import (
"log"
"net/http"
"time"
)
func Logger(inner http.Handler, name string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
inner.ServeHTTP(w, r)
log.Printf(
"%s\t%s\t%s\t%s",
r.Method,
r.RequestURI,
name,
time.Since(start),
)
})
}
func logError(err error) {
if err != nil {
log.Fatal(err)
}
}