From 0f113002ad1e3e599449964c0885ac3c0e66d871 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Sat, 7 Nov 2020 23:38:47 +0800 Subject: [PATCH] Fix asset paths --- main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 4b3a48c..fcb736c 100644 --- a/main.go +++ b/main.go @@ -28,11 +28,13 @@ func main() { panic(err) } - http.Handle("/js/", http.FileServer(http.Dir("."))) - http.Handle("/css/", http.FileServer(http.Dir("."))) - http.Handle("/favicon.ico", http.FileServer(http.Dir("."))) + http.Handle("/js/", http.FileServer(http.Dir("assets"))) + http.Handle("/css/", http.FileServer(http.Dir("assets"))) + http.Handle("/favicon.ico", http.FileServer(http.Dir("assets"))) + http.Handle("/data", http.FileServer(http.Dir("data"))) http.HandleFunc("/", index) + log.Printf("Listening on %v", server.Addr) err = server.ListenAndServe() if err != nil { panic(err)