Files
noticeUwuzu/panel/route/command.ts
T
2025-11-30 17:44:44 +09:00

26 lines
529 B
TypeScript

import express from "express";
const CommandExecute = express.Router();
import Commands from "@/scripts/commands/main";
CommandExecute.post("/actions/command-execute", (req, res) => {
try {
(async () => {
await Commands();
})();
res.status(202)
.send("Accepted");
} catch(err) {
res.status(500)
.send(`Error: ${err}`);
}
});
CommandExecute.get("/actions/command-execute", (req, res) => {
res.status(501)
.send("POST Only");
});
export default CommandExecute;