faq page; put uploads; config

This commit is contained in:
2026-11-13 22:40:33 -05:00
parent 882e6cafa3
commit 2e63dcbf31
6 changed files with 91 additions and 29 deletions
+8 -1
View File
@@ -40,6 +40,7 @@ func main() {
"templates/upload.html",
"templates/tos.html",
"templates/privacy.html",
"templates/faq.html",
)
if err != nil {
log.Fatal(err)
@@ -99,13 +100,19 @@ func main() {
data.PastePlaceholder = placeholders[rand.IntN(len(placeholders))]
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
render(pages, w, "home.html", data)
})
mux.HandleFunc("GET /tos", staticPage(pages, "tos.html"))
mux.HandleFunc("GET /privacy", staticPage(pages, "privacy.html"))
mux.HandleFunc("GET /faq", func(w http.ResponseWriter, r *http.Request) {
render(pages, w, "faq.html", map[string]any{
"Expiries": config.Expiries,
"Host": config.Host,
})
})
mux.HandleFunc("GET /{id}", contentHandler(db, config))
mux.HandleFunc("POST /upload", uploadHandler(db, config, pages))
mux.HandleFunc("PUT /upload", uploadHandler(db, config, pages))
mux.HandleFunc("DELETE /{id}", deleteHandler(db, config))
mux.HandleFunc("POST /{id}/delete", deleteHandler(db, config))
mux.HandleFunc("GET /health", health)