debug log

This commit is contained in:
Tordarus 2022-01-14 16:55:11 +01:00
parent 8d8f041946
commit 1128a10561

View File

@ -7,6 +7,7 @@ import (
"fmt"
"io"
"io/fs"
"log"
"net/http"
"net/url"
"os"
@ -44,6 +45,7 @@ func main() {
}
func handler(w http.ResponseWriter, r *http.Request) {
log.Println(r.Method, getPath(r.URL.Path, r))
switch r.Method {
case "GET":
get(w, r)
@ -86,8 +88,6 @@ func get(w http.ResponseWriter, r *http.Request) {
return
}
fmt.Println(path, files)
for _, file := range files {
fmt.Fprintln(w, url.QueryEscape(file.Name()))
}