Feat: Add strategy enable/disable + pause API

This commit is contained in:
2026-03-16 11:30:54 -07:00
parent 9015d0f524
commit 1d99902ca3

View File

@@ -0,0 +1,17 @@
import { NextResponse } from 'next/server';
import fs from 'fs';
export async function POST(req) {
try {
const body = await req.json();
const { action, strategy } = body;
// Write command file that worker polls
const cmd = JSON.stringify({ action, strategy, ts: Date.now() });
fs.writeFileSync('/tmp/kalbot-live-cmd', cmd);
return NextResponse.json({ success: true, message: `Command "${action}" sent.` });
} catch (e) {
return NextResponse.json({ error: e.message }, { status: 500 });
}
}