aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.go b/main.go
index cc4283c..cc05c3c 100644
--- a/main.go
+++ b/main.go
@@ -1,16 +1,26 @@
1package main 1package main
2 2
3import ( 3import (
4 "database/sql"
4 login "fagott.pw/charakterin" 5 login "fagott.pw/charakterin"
5 "fagott.pw/grilist/frontend" 6 "fagott.pw/grilist/frontend"
6 "github.com/julienschmidt/httprouter" 7 "github.com/julienschmidt/httprouter"
7 "log" 8 "log"
8 "net/http" 9 "net/http"
10
11 _ "github.com/lib/pq"
9) 12)
10 13
11func main() { 14func main() {
15 // Datenbankverbindung aufbauen
16 db, err := sql.Open("postgres", "host=grilist.moe user=grilist dbname=grilist password=grilist sslmode=disable")
17 if err != nil {
18 log.Fatal(err)
19 }
20 log.Println("database connection established")
21
12 frontend := frontend.New("views") 22 frontend := frontend.New("views")
13 charakterin := login.New() 23 charakterin := login.New(db)
14 charakterin.UseRenderer(frontend) 24 charakterin.UseRenderer(frontend)
15 25
16 router := httprouter.New() 26 router := httprouter.New()