Separating server and client for reasons ...

This commit is contained in:
2026-03-18 21:41:58 +00:00
parent 45c394cded
commit 0935788b69
3 changed files with 53 additions and 44 deletions

29
isolated/server/main.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"context"
"flag"
"log"
"os"
"path/filepath"
"git.hrafn.xyz/aether/notes/internal/repository"
"git.hrafn.xyz/aether/notes/internal/store/sqlite"
"git.hrafn.xyz/aether/notes/server"
)
func main() {
databasefile := flag.String("db", filepath.Join(os.Getenv("HOME"), "notes.db"), "Path to the SQLite database file")
dbPath := *databasefile
sqliteStore, err := sqlite.NewSQLiteStore(context.Background(), dbPath)
if err != nil {
panic(err)
}
defer sqliteStore.Close()
repo := repository.NewNoteRepository(sqliteStore)
s := server.GetServer(repo, log.Default())
err = s.Start(":8080")
if err != nil {
panic(err)
}
}