summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/main.go b/main.go
index ed988c9..79071e8 100644
--- a/main.go
+++ b/main.go
@@ -13,6 +13,7 @@ import (
"regexp"
"strconv"
+ "ricketyspace.net/peach/meta"
"ricketyspace.net/peach/search"
"ricketyspace.net/peach/version"
"ricketyspace.net/peach/weather"
@@ -52,6 +53,9 @@ func main() {
// Search handler.
http.HandleFunc("/search", showSearch)
+ // Meta handler.
+ http.HandleFunc("/about", showMeta)
+
// Start server
log.Fatal(http.ListenAndServe(peachAddr, nil))
}
@@ -100,6 +104,20 @@ func showWeather(w http.ResponseWriter, lat, lng float32) {
}
}
+func showMeta(w http.ResponseWriter, r *http.Request) {
+ logRequest(r)
+
+ // Make meta info.
+ meta := meta.NewMeta()
+
+ // Render.
+ err := peachTemplates.ExecuteTemplate(w, "about.tmpl", meta)
+ if err != nil {
+ log.Printf("weather: template: %v", err)
+ return
+ }
+}
+
func serveStaticFile(w http.ResponseWriter, r *http.Request) {
logRequest(r)