refactor: migrate auth routes to v1 package (#1841)

* feat: add api v1 packages

* chore: migrate auth to v1

* chore: update test
This commit is contained in:
boojack
2023-06-17 21:25:46 +08:00
committed by GitHub
parent f1d85eeaec
commit 4ed9a3a0ea
16 changed files with 180 additions and 131 deletions

View File

@@ -41,7 +41,15 @@ var (
Short: `An open-source, self-hosted memo hub with knowledge management and social networking.`,
Run: func(_cmd *cobra.Command, _args []string) {
ctx, cancel := context.WithCancel(context.Background())
s, err := server.NewServer(ctx, profile)
db := db.NewDB(profile)
if err := db.Open(ctx); err != nil {
cancel()
fmt.Printf("failed to open db, error: %+v\n", err)
return
}
store := store.New(db.DBInstance, profile)
s, err := server.NewServer(ctx, profile, store)
if err != nil {
cancel()
fmt.Printf("failed to create server, error: %+v\n", err)