How do I get only the file name one.json
from the following request: http://localhost/slow/one.json
?
I just need to serve this file and others from the url? This is a test server that I need to respond very slow.
http.HandleFunc("/slow/", func(w http.ResponseWriter, r *http.Request) {
log.Println("Slow...")
log.Println(r.URL.Path[1:])
time.Sleep(100 * time.Millisecond)
http.ServeFile(w, r, r.URL.Path[1:])
})