Servefile from right place
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2020-06-24 00:40:55 +02:00
parent feac796c19
commit 7f7c17830a

View File

@ -822,11 +822,11 @@ func main() {
http.Handle("/auth/", &authHandler{})
http.HandleFunc("/links.json", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
http.ServeFile(w, r, LinksFile)
http.ServeFile(w, r, filepath.Join(mp.(*FilePages).dirname, LinksFile))
})
http.HandleFunc("/documents.json", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
http.ServeFile(w, r, DocumentsFile)
http.ServeFile(w, r, filepath.Join(mp.(*FilePages).dirname, DocumentsFile))
})
http.HandleFunc("/fetchLink", func(w http.ResponseWriter, r *http.Request) {
link := r.URL.Query().Get("url")