diff options
Diffstat (limited to 'http')
| -rw-r--r-- | http/main.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/http/main.go b/http/main.go index 875f4b9..d7c6399 100644 --- a/http/main.go +++ b/http/main.go @@ -10,8 +10,8 @@ import ( "path/filepath" "strings" - "git.riedstra.dev/mitch/go-website/local" - "git.riedstra.dev/mitch/go-website/page" + "riedstra.dev/mitch/go-website/local" + "riedstra.dev/mitch/go-website/page" "github.com/gorilla/mux" ) @@ -23,6 +23,10 @@ var NewPage func(string) page.Page = func(u string) page.Page { return &local.Page{Path: u} } +// ReindexRedirectTo is the path that we'll redirect to when a call to rebuild +// index is called +var ReindexRedirectTo = "/fullIndex" + func GetHandler() http.Handler { if NewPage == nil { fmt.Fprintln(os.Stderr, "Warning, global NewPage method is not defined!") @@ -70,6 +74,7 @@ func RebuildIndexHandler(w http.ResponseWriter, r *http.Request) { if r.Method != "POST" { p := NewPage("index") _ = p.RebuildIndex() + http.Redirect(w, r, ReindexRedirectTo, 302) } } |
