We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bdef48 commit 388c20dCopy full SHA for 388c20d
023_serving-files/02_serving/04_FileServer/01/main.go
@@ -7,11 +7,11 @@ import (
7
8
func main() {
9
http.Handle("/", http.FileServer(http.Dir(".")))
10
- http.HandleFunc("/dog", dog)
+ http.HandleFunc("/dog/", dog)
11
http.ListenAndServe(":8080", nil)
12
}
13
14
func dog(w http.ResponseWriter, req *http.Request) {
15
w.Header().Set("Content-Type", "text/html; charset=utf-8")
16
- io.WriteString(w, `<img src="toby.jpg">`)
+ io.WriteString(w, `<img src="/toby.jpg">`)
17
0 commit comments