From aa1f256215db1b386f3a8c9bec299b802f533e7d Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Fri, 22 May 2015 15:34:06 -0700 Subject: [PATCH] move --- route_handlers.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/route_handlers.go b/route_handlers.go index 72b7c3c..5b8e7e8 100644 --- a/route_handlers.go +++ b/route_handlers.go @@ -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/"))))