create function findValue

This commit is contained in:
joseph le 2023-11-23 15:59:26 +07:00
parent 2767bc820d
commit c96c3bc277
1 changed files with 2 additions and 2 deletions

View File

@ -182,13 +182,13 @@ Route.post("/api/find-value", async ({ request, response }) => {
let result = "";
let value = request.all().value;
console.log("value ", value)
exec("grep -nr "+value+" /home/logs", (error, stdout, stderr) => {
if (error) {
// console.error(`Error executing command: ${error.message}`);
return "Error:"+ error;
}
console.log("stdout ", typeof stdout)
console.log("stdout ", stdout)
response.status(200).send(stdout);
});