From 7783ba588a7a53079acbec2843ee92a113ca23d0 Mon Sep 17 00:00:00 2001 From: jedarden Date: Tue, 7 Apr 2026 03:02:45 -0400 Subject: [PATCH] feat: register backup endpoint at /api/backup Wire up the SQLite Online Backup API streaming endpoint that was implemented in ad1e17d into the main router. Co-Authored-By: Claude Opus 4.6 --- mothership/cmd/mothership/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mothership/cmd/mothership/main.go b/mothership/cmd/mothership/main.go index 80cc86d..8967953 100644 --- a/mothership/cmd/mothership/main.go +++ b/mothership/cmd/mothership/main.go @@ -2961,6 +2961,11 @@ func main() { sleepHandler.RegisterRoutes(r) log.Printf("[INFO] Sleep quality API registered at /api/sleep/*") + // Backup API — streams a zip of all databases via SQLite Online Backup API + backupHandler := api.NewBackupHandler(cfg.DataDir, version) + r.Get("/api/backup", backupHandler.HandleBackup) + log.Printf("[INFO] Backup API registered at /api/backup") + // OTA firmware server and manager firmwareDir := filepath.Join(cfg.DataDir, "firmware") otaSrv := ota.NewServer(firmwareDir)