revert to local hosting

This commit is contained in:
Ishaan Dey
2024-05-26 17:28:52 -07:00
parent 640c5c13df
commit fbb98ac3b0
22 changed files with 824 additions and 3890 deletions

View File

@ -0,0 +1 @@
PORT=4000

View File

@ -22,7 +22,7 @@ USER appuser
# todo user namespace mapping
EXPOSE 3000
EXPOSE 5173
EXPOSE 4000
CMD [ "node", "dist/index.js" ]

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-ecs": "^3.577.0",
"concurrently": "^8.2.2",
"cors": "^2.8.5",
"dotenv": "^16.4.5",

View File

@ -6,35 +6,10 @@ import {
TFile,
TFileData,
TFolder,
User,
} from "./types";
import {
DeleteServiceCommand,
DescribeServicesCommand,
ECSClient,
} from "@aws-sdk/client-ecs";
dotenv.config();
const client = new ECSClient({
region: "us-east-1",
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
},
});
export const testDescribe = async () => {
const command = new DescribeServicesCommand({
cluster: "Sandbox",
services: ["Sandbox"],
});
const response = await client.send(command);
console.log("describing: ", response);
return response;
};
export const getSandboxFiles = async (id: string) => {
const res = await fetch(
`https://storage.ishaan1013.workers.dev/api?sandboxId=${id}`
@ -176,18 +151,3 @@ export const getProjectSize = async (id: string) => {
);
return (await res.json()).size;
};
export const stopServer = async (service: string) => {
const command = new DeleteServiceCommand({
cluster: process.env.AWS_ECS_CLUSTER!,
service,
force: true,
});
try {
const response = await client.send(command);
return response;
} catch (error) {
console.error("Error stopping server:", error);
}
};