refactor(API): ✨ Relspect integration
This commit is contained in:
@@ -70,10 +70,22 @@ func main() {
|
||||
|
||||
logging.Info("Starting WhatsHooked server", "config_path", cfgPath)
|
||||
|
||||
// Start the built-in HTTP server (non-blocking goroutine)
|
||||
// Create context for initialization
|
||||
ctx := context.Background()
|
||||
|
||||
// Start the ResolveSpec server
|
||||
// This serves both the WhatsApp API and the Admin UI
|
||||
if err := wh.StartServer(ctx); err != nil {
|
||||
logging.Error("Failed to start server", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Connect to WhatsApp accounts after a brief delay
|
||||
go func() {
|
||||
if err := wh.StartServer(); err != nil {
|
||||
logging.Error("HTTP server error", "error", err)
|
||||
time.Sleep(500 * time.Millisecond) // Give server a moment to start
|
||||
logging.Info("Server ready, connecting to WhatsApp accounts")
|
||||
if err := wh.ConnectAll(context.Background()); err != nil {
|
||||
logging.Error("Failed to connect to WhatsApp accounts", "error", err)
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user