change gke cluster
This commit is contained in:
@ -4,7 +4,7 @@ import dynamic from "next/dynamic";
|
||||
import Loading from "@/components/editor/loading";
|
||||
import { Sandbox, User } from "@/lib/types";
|
||||
import { useEffect, useState } from "react";
|
||||
import { startServer, stopServer } from "@/lib/utils";
|
||||
import { startServer } from "@/lib/utils";
|
||||
import { toast } from "sonner";
|
||||
|
||||
const CodeEditor = dynamic(() => import("@/components/editor/editor"), {
|
||||
@ -32,9 +32,9 @@ export default function Editor({
|
||||
}
|
||||
});
|
||||
|
||||
return () => {
|
||||
stopServer(sandboxData.id, userData.id);
|
||||
};
|
||||
// return () => {
|
||||
// stopServer(sandboxData.id, userData.id);
|
||||
// };
|
||||
}, []);
|
||||
|
||||
if (!isServerRunning)
|
||||
|
@ -29,7 +29,7 @@ export default function PreviewWindow({
|
||||
<div className="text-xs">
|
||||
Preview
|
||||
<span className="inline-block ml-2 items-center font-mono text-muted-foreground">
|
||||
localhost:3000
|
||||
localhost:8000
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex space-x-1 translate-x-1">
|
||||
|
@ -76,17 +76,4 @@ export async function startServer(sandboxId: string, userId: string, callback: (
|
||||
callback(false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const stopServer = async (sandboxId: string, userId: string) => {
|
||||
const res = await fetch("http://localhost:4001/stop", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
sandboxId,
|
||||
userId
|
||||
}),
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user