- Added Hermes tool to CLI tools and updated related components.

This commit is contained in:
decolua
2026-04-23 16:39:31 +07:00
parent ab7dd63b22
commit 368f4c3e7f
15 changed files with 821 additions and 38 deletions
+21
View File
@@ -0,0 +1,21 @@
import { NextResponse } from "next/server";
import { killAppProcesses, spawnUpdaterAndExit } from "@/lib/appUpdater";
export async function POST() {
if (process.env.NODE_ENV !== "production") {
return NextResponse.json(
{ success: false, message: "Update is only available in production build (9router CLI)" },
{ status: 403 }
);
}
try {
// Kill sibling processes (cloudflared, MITM, stray next-server) to release file locks on Windows
await killAppProcesses();
} catch { /* best effort */ }
// Schedule detached updater then exit current server process
spawnUpdaterAndExit();
return NextResponse.json({ success: true, message: "Updater started. This app will exit shortly." });
}