aboutsummaryrefslogtreecommitdiffstats
path: root/website.go
diff options
context:
space:
mode:
Diffstat (limited to 'website.go')
-rw-r--r--website.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/website.go b/website.go
index a917979..3cc30fc 100644
--- a/website.go
+++ b/website.go
@@ -92,3 +92,12 @@ func handlePage(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(os.Stderr, err)
}
}
+
+func handleGrill(w http.ResponseWriter, r *http.Request) {
+ grills, err := ioutil.ReadDir("static/grill/")
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ http.Redirect(w, r, "/static/grill/"+grills[rand.Intn(len(grills))].Name(), http.StatusFound)
+}