Save current v2 sandbox implementation before styling refactor
- Modified sandbox API routes for v2 implementation - Updated sandbox providers (E2B and Vercel) - Added styling-reference directory with Firecrawl AI-ready website - Preparing for styling system port from Firecrawl design Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
declare global {
|
||||
var activeSandbox: any;
|
||||
var activeSandboxProvider: any;
|
||||
var sandboxData: any;
|
||||
var existingFiles: Set<string>;
|
||||
}
|
||||
@@ -9,19 +9,19 @@ declare global {
|
||||
export async function POST() {
|
||||
try {
|
||||
console.log('[kill-sandbox] Stopping active sandbox...');
|
||||
|
||||
|
||||
let sandboxKilled = false;
|
||||
|
||||
|
||||
// Stop existing sandbox if any
|
||||
if (global.activeSandbox) {
|
||||
if (global.activeSandboxProvider) {
|
||||
try {
|
||||
await global.activeSandbox.stop();
|
||||
await global.activeSandboxProvider.terminate();
|
||||
sandboxKilled = true;
|
||||
console.log('[kill-sandbox] Sandbox stopped successfully');
|
||||
} catch (e) {
|
||||
console.error('[kill-sandbox] Failed to stop sandbox:', e);
|
||||
}
|
||||
global.activeSandbox = null;
|
||||
global.activeSandboxProvider = null;
|
||||
global.sandboxData = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user