process & save upload

This commit is contained in:
2026-11-08 21:18:53 -05:00
parent 1c99c5dd11
commit 673c039d1c
2 changed files with 78 additions and 8 deletions
+3 -2
View File
@@ -15,7 +15,7 @@ func main() {
log.Println("config loaded")
_, err = initDatabase(config.DatabasePath)
db, err := initDatabase(config.DatabasePath)
if err != nil {
log.Fatal(err)
@@ -27,7 +27,7 @@ func main() {
log.Fatal(err)
}
pages, err := template.ParseFiles("templates/home.html", "templates/paste.html")
pages, err := template.ParseFiles("templates/home.html")
if err != nil {
log.Fatal(err)
}
@@ -45,6 +45,7 @@ func main() {
log.Println("render home page:", err)
}
})
mux.HandleFunc("POST /upload", uploadHandler(db, config))
mux.HandleFunc("GET /health", health)
log.Println("listening on http://localhost:8080")