Basti1110 commited on
Commit
e452526
·
verified ·
1 Parent(s): 9d46c5d

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +8 -3
app.js CHANGED
@@ -79,11 +79,16 @@ Analyze the following content in ${language}:
79
  const jsonEnd = raw.lastIndexOf('}');
80
  const jsonString = raw.slice(jsonStart, jsonEnd + 1);
81
  const osintData = JSON.parse(jsonString);
82
- exec('python3 render_report.py', () => { ... });
83
 
84
  fs.writeFileSync('data.json', JSON.stringify(osintData));
85
- exec('python3 render_report.py', () => {
86
- res.sendFile(path.join(__dirname, '/mnt/data/OSINT_Report.html'));
 
 
 
 
 
 
87
  });
88
 
89
  } catch (error) {
 
79
  const jsonEnd = raw.lastIndexOf('}');
80
  const jsonString = raw.slice(jsonStart, jsonEnd + 1);
81
  const osintData = JSON.parse(jsonString);
 
82
 
83
  fs.writeFileSync('data.json', JSON.stringify(osintData));
84
+
85
+ exec('python3 render_report.py', (error, stdout, stderr) => {
86
+ if (error) {
87
+ console.error('Error generating report:', stderr);
88
+ res.status(500).send('Error rendering the report.');
89
+ } else {
90
+ res.sendFile(path.join(__dirname, '/mnt/data/OSINT_Report.html'));
91
+ }
92
  });
93
 
94
  } catch (error) {