
Co-authored-by: Dunemask <dunemask@gmail.com> Reviewed-on: https://gitea.dunemask.dev/elysium/minecluster/pulls/12
18 lines
583 B
JavaScript
18 lines
583 B
JavaScript
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));
|
|
}
|