minecluster/lib/controllers/status-controller.ts
2024-03-29 16:54:12 -06:00

19 lines
598 B
TypeScript

// @ts-nocheck
import { getUserDeployments } from "../k8s/k8s-server-control.js";
import { getInstances } from "../k8s/server-status.js";
import { sendError } from "../util/ExpressClientError.js";
export function serverList(req, res) {
getUserDeployments(req.cairoId)
.then((sd) => res.json(sd.map((s) => s.metadata.name.substring(4))))
.catch((e) => {
ERR("STATUS CONTROLLER", e);
res.status(500).send("Couldn't get server list");
});
}
export function serverInstances(req, res) {
getInstances(req.cairoId)
.then((i) => res.json(i))
.catch(sendError(res));
}