Added database initialization
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user