logging erweitert
This commit is contained in:
parent
d880e423b1
commit
ba8dc01863
8
http.go
8
http.go
|
@ -6,8 +6,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func httpHandleFunc(urlPath string, filepath string, contentType string) {
|
func httpHandleFunc(urlPath string, filepath string, contentType string) {
|
||||||
logger(readHttpYML() + "/" + urlPath + " - " + filepath + " " + contentType)
|
logger(readHttpYML() + "/" + urlPath + " - " + filepath + " <" + contentType + ">")
|
||||||
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
logger(r.Method + " - request -> " + readHttpYML() + "/" + urlPath + " <" + contentType + ">")
|
||||||
|
|
||||||
w.Header().Add("Content-Type", contentType)
|
w.Header().Add("Content-Type", contentType)
|
||||||
|
|
||||||
io.WriteString(w, htmlReplacer(fileRead(filepath), urlPath))
|
io.WriteString(w, htmlReplacer(fileRead(filepath), urlPath))
|
||||||
|
@ -15,7 +17,7 @@ func httpHandleFunc(urlPath string, filepath string, contentType string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string) {
|
func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string) {
|
||||||
logger(readHttpYML() + "/" + urlPath + " - " + filepath + " " + contentType)
|
logger(readHttpYML() + "/" + urlPath + " - " + filepath + " <" + contentType + ">")
|
||||||
s := new(submit)
|
s := new(submit)
|
||||||
s.data = "null"
|
s.data = "null"
|
||||||
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -24,6 +26,8 @@ func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string)
|
||||||
errorPanic(err)
|
errorPanic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger(r.Method + " - request -> " + readHttpYML() + "/" + urlPath + " <" + contentType + ">")
|
||||||
|
|
||||||
w.Header().Add("Content-Type", contentType)
|
w.Header().Add("Content-Type", contentType)
|
||||||
|
|
||||||
io.WriteString(w, htmlReplacer(fileRead(filepath), urlPath))
|
io.WriteString(w, htmlReplacer(fileRead(filepath), urlPath))
|
||||||
|
|
Loading…
Reference in New Issue