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 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-07 03:02:45 -04:00
parent 431ec0e96f
commit 7783ba588a

View file

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