made simple "command" sending
This commit is contained in:
17
server.js
17
server.js
@@ -12,11 +12,17 @@ app.get('/', (req, res) => {
|
||||
})
|
||||
|
||||
app.get("/execute", (req, res)=> {
|
||||
const raw_command = req.body.command;
|
||||
const formatted_command = toString(raw_command).trim()
|
||||
if (formatted_command.startsWith("ls")){
|
||||
const raw_command = req.query.command;
|
||||
const formatted_command = String(raw_command).trim();
|
||||
|
||||
}
|
||||
console.log(`Executed Command: ${formatted_command}`);
|
||||
|
||||
if (formatted_command.startsWith("ls")){
|
||||
LS(req, res);
|
||||
}
|
||||
else {
|
||||
res.json({"response": "invalid command"})
|
||||
}
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
@@ -25,6 +31,7 @@ app.listen(port, () => {
|
||||
|
||||
|
||||
|
||||
function LS () {
|
||||
function LS (req, res) {
|
||||
res.json({"response": "LS IS WEL FICKING EPISCH"});
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user