Added test cli functionality

This commit is contained in:
Julian Appel 2024-05-31 21:05:22 +02:00
parent ad6ab2ecab
commit 1d632252bf
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,13 @@
const exec = require('node:child_process');
// run the `ls` command using exec
exec('ls ./', (err, output) => {
// once the command has completed, the callback function is called
if (err) {
// log and return if we encounter an error
console.error("could not execute command: ", err)
return
}
// log the output received from the command
console.log("Output: \n", output)
})

View File

@ -17,6 +17,12 @@ router.get('/refreshMonitor', function(req, res, next) {
res.send(); // send empty response
});
// Express router endpoint to do cli stuff
router.get('/cli', function(req, res, next) {
res.status(200); // Set http status code to 200 (success)
res.send(); // send empty response
});
// ######################################################################################################################################################
// Timerendpoints
// ######################################################################################################################################################