diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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) |