Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaur2210 committed Dec 20, 2023
1 parent dd66be7 commit 433cc44
Show file tree
Hide file tree
Showing 12 changed files with 109,899 additions and 674 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 21 additions & 9 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,31 @@ const runSbomGenerator = (pathh) => {
const destinationFilePath = path.join(destinationFolderPath, newFileName);
console.log(fs.existsSync(sourceFilePath));
fs.renameSync(sourceFilePath, destinationFilePath);

// Insert the new path into MySQL database
const insertQuery = `INSERT INTO data (html,uploaded) VALUES ('${destinationFilePath}', '${new Date()
.toISOString()
.slice(0, 19)
.replace("T", " ")}')`;
con.query(insertQuery, (err, results) => {
con.query(`SELECT MAX(id) FROM data`, (err, results) => {
if (err) {
console.error("Error inserting data:", err);
console.error("Error retrieving data:", err);
} else {
console.log("Data inserted successfully. Row ID:", results.insertId);
let id = (results[0]["MAX(id)"]) ? results[0]["MAX(id)"] : 0;
const insertQuery = `INSERT INTO data (id, html,uploaded) VALUES (${
id + 1
}, '${destinationFilePath}', '${new Date()
.toISOString()
.slice(0, 19)
.replace("T", " ")}')`;
con.query(insertQuery, (err, results) => {
if (err) {
console.error("Error inserting data:", err);
} else {
console.log(
"Data inserted successfully. Row ID:",
results.insertId
);
}
});
}
});

// Insert the new path into MySQL database
});
};

Expand Down
428 changes: 214 additions & 214 deletions server/reports/depscan-universal.json

Large diffs are not rendered by default.

898 changes: 449 additions & 449 deletions server/reports/depscan.html

Large diffs are not rendered by default.

Loading

0 comments on commit 433cc44

Please sign in to comment.