Added database initialization

This commit is contained in:
2026-04-29 21:50:44 +02:00
parent 19e66e93d6
commit 9dbc6dc414
+8
View File
@@ -4,9 +4,17 @@ import (
"html/template" "html/template"
"log" "log"
"net/http" "net/http"
"os"
"192.168.1.180/odonax/filehost-athome/database"
) )
func main() { func main() {
os.MkdirAll("data/files", 0755)
db := database.Open("data/hub.db")
defer db.Close()
tmpl, err := template.ParseFiles("templates/home.html") tmpl, err := template.ParseFiles("templates/home.html")
if err != nil { if err != nil {
log.Fatal("Failed to load template:", err) log.Fatal("Failed to load template:", err)