added some more commands
This commit is contained in:
17
server.js
17
server.js
@@ -18,7 +18,7 @@ app.get("/execute", (req, res)=> {
|
||||
if (raw_command == ""){
|
||||
commands.customTextResponse(res, "");
|
||||
return;
|
||||
}
|
||||
}a
|
||||
|
||||
const formatted_command = raw_command.trim();
|
||||
const command = formatted_command.split(" ")[0]
|
||||
@@ -29,6 +29,21 @@ app.get("/execute", (req, res)=> {
|
||||
break;
|
||||
case "ls":
|
||||
commands.ls(res);
|
||||
break;
|
||||
case "whoami":
|
||||
commands.whoami(res);
|
||||
break;
|
||||
case "cd":
|
||||
commands.cd(res, formatted_command);
|
||||
break;
|
||||
case "pwd":
|
||||
commands.pwd(res);
|
||||
break;
|
||||
case "cat":
|
||||
commands.cat(res, formatted_command )
|
||||
break;
|
||||
case "help":
|
||||
commands.help(res);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user