Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ServeCmd = &cobra.Command{ Use: "serve", Short: "Start the API server", Long: "Start the Waypoint API server. The server provides IP geolocation endpoints and optionally serves the web UI.", Aliases: []string{"server", "run"}, SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() dbConn, err := db.New(ctx, config.Current) if err != nil { return err } mmClient := maxmind.NewClient(&config.Current.MaxMind, config.Current.Core.DataDir) if config.Current.Core.Environment != config.EnvironmentDevelopment { if err := mmClient.DownloadAllDB(); err != nil { return err } } else { if err := mmClient.Load(); err != nil { slog.Warn("Failed to load MaxMind databases", "error", err) } } if config.Current.MaxMind.AutoUpdate { go mmClient.RunDBDownloadJob(ctx) } server := NewServer(ctx, config.Current, mmClient, dbConn.DB) if err := server.Init(); err != nil { return err } return server.serve() }, }
ServeCmd represents the server command.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.