revert to local hosting
This commit is contained in:
1
backend/server/.env.example
Normal file
1
backend/server/.env.example
Normal file
@ -0,0 +1 @@
|
||||
PORT=4000
|
@ -22,7 +22,7 @@ USER appuser
|
||||
|
||||
# todo user namespace mapping
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 5173
|
||||
EXPOSE 4000
|
||||
|
||||
CMD [ "node", "dist/index.js" ]
|
1157
backend/server/package-lock.json
generated
1157
backend/server/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user