This commit is contained in:
Dan Ballard 2015-05-22 15:34:06 -07:00
parent d0fbd617b3
commit aa1f256215
1 changed files with 5 additions and 4 deletions

View File

@ -243,10 +243,6 @@ func addedHandler(w http.ResponseWriter, r *http.Request, user *user.User) {
ShowTemplate("added", w, map[string]interface{}{"user": user, "flashes": flashes})
}
func ServeFileHandler(res http.ResponseWriter, req *http.Request) {
fname := path.Base(req.URL.Path)
http.ServeFile(res, req, "./"+fname)
}
func categoriesFormHandler(w http.ResponseWriter, r *http.Request, user *user.User) {
session, _ := store.Get(r, "c_user")
@ -261,6 +257,11 @@ func categoriesPostHandler(w http.ResponseWriter, r *http.Request, user *user.Us
http.Redirect(w, r, "/categories", http.StatusFound)
}
func ServeFileHandler(res http.ResponseWriter, req *http.Request) {
fname := path.Base(req.URL.Path)
http.ServeFile(res, req, "./"+fname)
}
func init_route_handlers() {
http.Handle("/js/", http.StripPrefix("/js/", http.FileServer(http.Dir("js/"))))
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("css/"))))