Skip to content

Commit a312332

Browse files
committed
in class examples
1 parent 71eb258 commit a312332

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed
5.04 KB
Loading

000_temp/46_sp17/36_ServeFile/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77

88
func main() {
99
http.HandleFunc("/", index)
10+
http.HandleFunc("/main.css", css)
11+
http.HandleFunc("/bali.jpg", bali)
1012
http.ListenAndServe(":8080", nil)
1113
}
1214

@@ -26,3 +28,11 @@ func index(w http.ResponseWriter, r *http.Request) {
2628
</body>
2729
</html>`)
2830
}
31+
32+
func css(w http.ResponseWriter, r *http.Request) {
33+
http.ServeFile(w, r, "main.css")
34+
}
35+
36+
func bali(w http.ResponseWriter, r *http.Request) {
37+
http.ServeFile(w, r, "bali.jpg")
38+
}

000_temp/46_sp17/36_ServeFile/temp.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)