Download books

This commit is contained in:
Las Zenow 2012-07-31 00:42:02 +02:00
parent 679df42dde
commit 614ce0309a
2 changed files with 3 additions and 0 deletions

View file

@ -8,3 +8,5 @@
<li><strong>Date:</strong> {{.Date}}</li>
<li><strong>Lang:</strong> {{range .Lang}}{{.}} {{end}}</li>
</ul>
<p><a href="/{{.Path}}">download</a></p>

View file

@ -58,6 +58,7 @@ func main() {
http.HandleFunc("/search/", func(w http.ResponseWriter, r *http.Request) { searchHandler(coll, w, r) })
http.HandleFunc("/img/", sendFile)
http.HandleFunc("/cover/", sendFile)
http.HandleFunc("/books/", sendFile)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { loadTemplate(w, "front", nil) })
http.ListenAndServe(":8080", nil)
}