move
This commit is contained in:
parent
d0fbd617b3
commit
aa1f256215
|
@ -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/"))))
|
||||
|
|
Loading…
Reference in New Issue