Spaces:
Sleeping
Sleeping
Update app.js
Browse files
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 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) {
|