mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 07:06:36 +08:00
feat(core): implement app profile lifecycle dispatcher and wire cli commands
This commit is contained in:
+7
-7
@@ -5,8 +5,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/Rain-kl/Wavelet/internal/platform/bootstrap"
|
||||
"github.com/Rain-kl/Wavelet/internal/router"
|
||||
"log"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -14,10 +15,9 @@ var apiCmd = &cobra.Command{
|
||||
Use: "api",
|
||||
Short: "wavelet API",
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
bootstrap.RegisterAPI()
|
||||
runBootstrap(bootstrap.Options{API: true})
|
||||
router.Serve(func() {
|
||||
printStartupBanner(startupState{mode: "API", relationalDB: latestMigrationState.relationalDB, clickHouseDB: latestMigrationState.clickHouseDB, listensForHTTP: true})
|
||||
})
|
||||
app := newWaveletApp(core.ProfileAPI)
|
||||
if err := app.Run(); err != nil {
|
||||
log.Fatalf("[API] run failed: %v\n", err)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user