From de8f0420199ea72da469ce4af62ee4177662bad6 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 14 May 2023 03:33:55 +0400 Subject: [PATCH] Renamed sqlite DB for guestbook as gbsqlite. --- cmd/dwelling-home/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/dwelling-home/main.go b/cmd/dwelling-home/main.go index 67102db..88fc8b7 100644 --- a/cmd/dwelling-home/main.go +++ b/cmd/dwelling-home/main.go @@ -14,6 +14,7 @@ import ( "git.arav.su/Arav/dwelling-home/internal/http" "git.arav.su/Arav/dwelling-home/pkg/mindflow/database/sqlite" + gbsqlite "git.arav.su/Arav/justguestbook/database/sqlite" ) var version string @@ -50,7 +51,7 @@ func main() { } } - guestbookDB, err := sqlite.New(path.Join(*databasesPath, "guestbook.sqlite")) + guestbookDB, err := gbsqlite.New(path.Join(*databasesPath, "guestbook.sqlite")) if err != nil { log.Fatalln(err) } @@ -92,7 +93,12 @@ func main() { srv.PATCH("/api/guestbook/:id/reply", guestbookApi.EditReply) srv.DELETE("/api/guestbook/:id/reply", guestbookApi.DeleteReply) - mindflowApi := http.NewMindflowApiHandlers() + mindflowDB, err := sqlite.NewSQLiteMindflow(path.Join(*databasesPath, "mindflow.sqlite")) + if err != nil { + log.Fatalln(err) + } + + mindflowApi := http.NewMindflowApiHandlers(mindflowDB) srv.POST("/api/mindflow", mindflowApi.New) srv.POST("/api/mindflow/:id", mindflowApi.Edit)