diff options
author | ache <ache@ache.one> | 2019-03-03 06:44:05 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-03-03 06:44:05 +0100 |
commit | c1d82121bef766bcd6bd8c1ed00a928265ef1766 (patch) | |
tree | 03267a9d1937fac8f54b21900d70c6c865c35428 /server.go | |
parent | Fill button (diff) |
Kawaii power
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -416,6 +416,15 @@ func main() { } tmpl = template.Must(template.New("dir.html").Funcs(fmap).ParseFiles("dir.html")) + base_wd,_ := os.Getwd(); + + http.HandleFunc("/pink.svg", func(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, base_wd + "/pink.svg") + }); + http.HandleFunc("/test.svg", func(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, base_wd + "/test.svg") + }) + if err := os.Chdir(dir) ; err != nil { fmt.Println("Error with directory [" + dir + "]") return @@ -423,6 +432,7 @@ func main() { fmt.Println("Launch server") http.HandleFunc("/", handleMethod) + log.Fatal(http.ListenAndServe(":8080", nil)) fmt.Println("Bye bye") } |