refactor(API): Relspect integration
Some checks failed
CI / Test (1.23) (push) Failing after -22m46s
CI / Test (1.22) (push) Failing after -22m32s
CI / Build (push) Failing after -23m30s
CI / Lint (push) Failing after -23m12s

This commit is contained in:
Hein
2026-02-05 13:39:43 +02:00
parent 71f26c214f
commit f9773bd07f
33 changed files with 7512 additions and 58 deletions

View File

@@ -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)
}
}()