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