summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-03-03 06:44:05 +0100
committerache <ache@ache.one>2019-03-03 06:44:05 +0100
commitc1d82121bef766bcd6bd8c1ed00a928265ef1766 (patch)
tree03267a9d1937fac8f54b21900d70c6c865c35428 /server.go
parentFill button (diff)
Kawaii power
Diffstat (limited to 'server.go')
-rw-r--r--server.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/server.go b/server.go
index 7e6d54d..dcae977 100644
--- a/server.go
+++ b/server.go
@@ -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")
}