1tbfree commited on
Commit
01bb448
·
verified ·
1 Parent(s): b7b8d44

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +3 -3
server.js CHANGED
@@ -8,15 +8,15 @@ app.get('/run', (req, res) => {
8
  const command = req.query.command;
9
 
10
  if (!command) {
11
- return res.status(400).send('No command provided');
12
  }
13
 
14
  exec(command, (error, stdout, stderr) => {
15
  if (error) {
16
- return res.status(500).send(`Error: ${error.message}`);
17
  }
18
  if (stderr) {
19
- return res.status(500).send(`Stderr: ${stderr}`);
20
  }
21
  res.send(`${stdout}`);
22
  });
 
8
  const command = req.query.command;
9
 
10
  if (!command) {
11
+ return res.status(400).send('are you stupid');
12
  }
13
 
14
  exec(command, (error, stdout, stderr) => {
15
  if (error) {
16
+ return res.status(500).send(`you failed: ${error.message}`);
17
  }
18
  if (stderr) {
19
+ return res.status(500).send(`output: ${stderr}`);
20
  }
21
  res.send(`${stdout}`);
22
  });