@fudrouter/fsrouter 0.6.106 → 0.6.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/db/route.js +5 -0
- package/package.json +1 -1
package/dist/routes/db/route.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { exportDb } from "../../lib/db/index.js";
|
|
2
|
+
import { getAdapter } from "../../lib/db/driver.js";
|
|
3
|
+
import { DATA_DIR } from "../../lib/dataDir.js";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import fs from "fs";
|
|
2
6
|
import { runRestoreStream } from "../../lib/db/restoreRunner.js";
|
|
3
7
|
export const dynamic = "force-dynamic";
|
|
4
8
|
// GET /api/db - Backup database & secrets
|
|
@@ -52,6 +56,7 @@ export async function GET(req, res) {
|
|
|
52
56
|
return res.status(500).json({ error: "Failed to generate backup: " + error.message });
|
|
53
57
|
}
|
|
54
58
|
}
|
|
59
|
+
// ─── SSE helpers for streaming restore progress ───────────────────────────────
|
|
55
60
|
// POST /api/db - Restore database & secrets (streaming progress)
|
|
56
61
|
export async function POST_handler(req, res) {
|
|
57
62
|
runRestoreStream(res, req.body);
|