From 6961005146be308546304e3e9f86a3d37750c297 Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 19 Dec 2015 15:43:00 +0100 Subject: datenbankverbindung diff --git a/main.go b/main.go index cc4283c..cc05c3c 100644 --- a/main.go +++ b/main.go @@ -1,16 +1,26 @@ package main import ( + "database/sql" login "fagott.pw/charakterin" "fagott.pw/grilist/frontend" "github.com/julienschmidt/httprouter" "log" "net/http" + + _ "github.com/lib/pq" ) func main() { + // Datenbankverbindung aufbauen + db, err := sql.Open("postgres", "host=grilist.moe user=grilist dbname=grilist password=grilist sslmode=disable") + if err != nil { + log.Fatal(err) + } + log.Println("database connection established") + frontend := frontend.New("views") - charakterin := login.New() + charakterin := login.New(db) charakterin.UseRenderer(frontend) router := httprouter.New() -- cgit v0.10.1