diff --git a/internal/web/web.go b/internal/web/web.go index 44dbf4a..fae4088 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -23,7 +23,7 @@ func StartWebserver(addr string, client client.Client) error { r := mux.NewRouter() r.HandleFunc("/{slug:[a-zA-Z0-9]{6}}", func(w http.ResponseWriter, r *http.Request) { - + http.ServeFile(w, r, "./public/index.html") }) r.HandleFunc("/s/{slug:[a-zA-Z0-9]{6}}", func(w http.ResponseWriter, r *http.Request) { @@ -114,6 +114,8 @@ func StartWebserver(addr string, client client.Client) error { } }).Methods("DELETE") + r.PathPrefix("/").Handler(http.FileServer(http.Dir("./public/"))) + logrus.Info("Starting webserver") return http.ListenAndServe(addr, r) }