faq page; put uploads; config
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user