aboutsummaryrefslogtreecommitdiff
path: root/view.go
diff options
context:
space:
mode:
Diffstat (limited to 'view.go')
-rw-r--r--view.go22
1 files changed, 0 insertions, 22 deletions
diff --git a/view.go b/view.go
deleted file mode 100644
index 3a1c47a..0000000
--- a/view.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package main
-
-import (
- "net/http"
- "text/template"
-)
-
-func init() {
- http.HandleFunc("/view/", viewHandler)
-}
-
-var viewtmpl = template.Must(template.ParseFiles("tmpl/root", "tmpl/view"))
-
-func viewHandler(w http.ResponseWriter, r *http.Request) {
- title := r.URL.Path[len("/view/"):]
- p, err := loadPage(title)
- if err != nil {
- http.Redirect(w, r, "/edit/"+title, http.StatusFound)
- return
- }
- p.render(w, viewtmpl)
-}