First frontend revision

This commit is contained in:
nemunaire 2016-06-26 17:54:08 +02:00
commit 192548e38b
5 changed files with 7755 additions and 2 deletions

View file

@ -44,7 +44,10 @@ func main() {
authFunc := func (r *http.Request) (*User){ return Authenticate(*htpasswd, r) }
mux := http.NewServeMux()
mux.Handle("/", http.FileServer(http.Dir("./static/")))
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "./static/index.html") })
mux.Handle("/css/", http.FileServer(http.Dir("./static")))
mux.Handle("/js/", http.FileServer(http.Dir("./static")))
mux.Handle("/api/", http.StripPrefix("/api", ApiHandler(authFunc)))
mux.Handle("/images/", http.StripPrefix("/images", ImagesHandler(