Added database initialization
This commit is contained in:
@@ -4,9 +4,17 @@ import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"192.168.1.180/odonax/filehost-athome/database"
|
||||
)
|
||||
|
||||
func main() {
|
||||
os.MkdirAll("data/files", 0755)
|
||||
|
||||
db := database.Open("data/hub.db")
|
||||
defer db.Close()
|
||||
|
||||
tmpl, err := template.ParseFiles("templates/home.html")
|
||||
if err != nil {
|
||||
log.Fatal("Failed to load template:", err)
|
||||
|
||||
Reference in New Issue
Block a user