From 4a2fb7e82d5d617298cb28b66485fc6f30c55781 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 21 Apr 2021 17:23:07 +0200 Subject: Reworked the webui package, added authentication feature and tests --- cmd/trains-webui/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cmd/trains-webui') diff --git a/cmd/trains-webui/main.go b/cmd/trains-webui/main.go index 0ea3b57..c33cbbf 100644 --- a/cmd/trains-webui/main.go +++ b/cmd/trains-webui/main.go @@ -7,6 +7,7 @@ import ( "git.adyxax.org/adyxax/trains/internal/webui" "git.adyxax.org/adyxax/trains/pkg/config" + "git.adyxax.org/adyxax/trains/pkg/database" ) func main() { @@ -23,5 +24,14 @@ func main() { if err != nil { log.Fatal(err) } - webui.Run(c) + + db, err := database.InitDB("sqlite3", "file:test.db?_foreign_keys=on") + if err != nil { + log.Fatal(err) + } + if err := db.Migrate(); err != nil { + log.Fatal(err) + } + + webui.Run(c, db) } -- cgit v1.2.3