First frontend revision
This commit is contained in:
parent
c1af90eccf
commit
192548e38b
5 changed files with 7755 additions and 2 deletions
5
main.go
5
main.go
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue