private log

This commit is contained in:
joseph le 2023-10-31 13:57:26 +07:00
parent cb52ae28a4
commit b7da9e5805
1 changed files with 7 additions and 1 deletions

View File

@ -340,7 +340,13 @@ Route.post("/api/private-log/readFile", async ({ request, response }) => {
try {
let result = [];
let path = request.all().filePath;
return fs.readFile(path)
await fs.readFile(path, (err, data)=>{
if(err){
return err
}
return data.toString()
})
} catch (error) {
console.log(error);
}