12 lines
415 B
JavaScript
12 lines
415 B
JavaScript
|
import { listServerFiles } from "../k8s/server-files.js";
|
||
|
import { sendError } from "../util/ExpressClientError.js";
|
||
|
|
||
|
export async function listFiles(req, res) {
|
||
|
const serverSpec = req.body;
|
||
|
if (!serverSpec) return res.sendStatus(400);
|
||
|
if (!serverSpec.name) return res.status(400).send("Server name required!");
|
||
|
listServerFiles(serverSpec)
|
||
|
.then(() => res.sendStatus(200))
|
||
|
.catch(sendError(res));
|
||
|
}
|