diff options
author | Julien Dessaux | 2021-04-21 17:23:07 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-04-21 17:23:07 +0200 |
commit | 4a2fb7e82d5d617298cb28b66485fc6f30c55781 (patch) | |
tree | 4ae55d8208e3ebf603f3a17ac56f6efd0e011efc /cmd/trains-webui | |
parent | Implemented the ResumeSession function (diff) | |
download | trains-4a2fb7e82d5d617298cb28b66485fc6f30c55781.tar.gz trains-4a2fb7e82d5d617298cb28b66485fc6f30c55781.tar.bz2 trains-4a2fb7e82d5d617298cb28b66485fc6f30c55781.zip |
Reworked the webui package, added authentication feature and tests
Diffstat (limited to 'cmd/trains-webui')
-rw-r--r-- | cmd/trains-webui/main.go | 12 |
1 files changed, 11 insertions, 1 deletions
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) } |