mirror of
https://github.com/teamhanko/hanko.git
synced 2025-10-27 06:06:54 +08:00
34 lines
704 B
Go
34 lines
704 B
Go
/*
|
|
Copyright © 2022 Hanko GmbH <developers@hanko.io>
|
|
*/
|
|
package serve
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/teamhanko/hanko/backend/config"
|
|
"github.com/teamhanko/hanko/backend/persistence"
|
|
"github.com/teamhanko/hanko/backend/server"
|
|
"log"
|
|
"sync"
|
|
)
|
|
|
|
func NewServeAdminCommand(config *config.Config) *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "admin",
|
|
Short: "Start the admin portion of the hanko server",
|
|
Long: ``,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
persister, err := persistence.New(config.Database)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
var wg sync.WaitGroup
|
|
wg.Add(1)
|
|
|
|
go server.StartAdmin(config, &wg, persister, nil)
|
|
|
|
wg.Wait()
|
|
},
|
|
}
|
|
}
|