aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJulien Dessaux2021-04-21 17:23:07 +0200
committerJulien Dessaux2021-04-21 17:23:07 +0200
commit4a2fb7e82d5d617298cb28b66485fc6f30c55781 (patch)
tree4ae55d8208e3ebf603f3a17ac56f6efd0e011efc /cmd
parentImplemented the ResumeSession function (diff)
downloadtrains-4a2fb7e82d5d617298cb28b66485fc6f30c55781.tar.gz
trains-4a2fb7e82d5d617298cb28b66485fc6f30c55781.tar.bz2
trains-4a2fb7e82d5d617298cb28b66485fc6f30c55781.zip
Reworked the webui package, added authentication feature and tests
Diffstat (limited to 'cmd')
-rw-r--r--cmd/trains-webui/main.go12
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)
}