microblog.go aktualisiert
This commit is contained in:
+3
-1
@@ -24,11 +24,13 @@ func main() {
|
|||||||
println("Server startet http://localhost:8085")
|
println("Server startet http://localhost:8085")
|
||||||
|
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
println("start HandleFunc")
|
||||||
path := r.URL.Path
|
path := r.URL.Path
|
||||||
ext := filepath.Ext(path)
|
ext := filepath.Ext(path)
|
||||||
|
|
||||||
switch ext {
|
switch ext {
|
||||||
case ".css":
|
case ".css":
|
||||||
|
println("css gefunden")
|
||||||
w.Header().Set("Content-Type", "text/css")
|
w.Header().Set("Content-Type", "text/css")
|
||||||
case ".jpg", ".jpeg":
|
case ".jpg", ".jpeg":
|
||||||
w.Header().Set("Content-Type", "image/jpeg")
|
w.Header().Set("Content-Type", "image/jpeg")
|
||||||
@@ -37,7 +39,7 @@ func main() {
|
|||||||
case ".gif":
|
case ".gif":
|
||||||
w.Header().Set("Content-Type", "image/gif")
|
w.Header().Set("Content-Type", "image/gif")
|
||||||
default:
|
default:
|
||||||
fmt.Println("rufe handlePage")
|
println("rufe handlePage")
|
||||||
handlePage(w,r)
|
handlePage(w,r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user