Correcting project layout
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"git.hrafn.xyz/aether/gotes/internal/repository"
|
||||
"git.hrafn.xyz/aether/gotes/internal/store/sqlite"
|
||||
"git.hrafn.xyz/aether/gotes/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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user