change gke cluster

This commit is contained in:
Ishaan Dey
2024-05-13 03:00:15 -07:00
parent 59fb0521af
commit 5df770bdd6
7 changed files with 18 additions and 44 deletions

View File

@ -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)

View File

@ -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">

View File

@ -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
}),
})
}