Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions myserver.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const express = require("express");
const bodyParser = require("body-parser");
const axios = require('axios');
const app = express();
const port = process.env.PORT || 5000;

Expand All @@ -11,10 +12,22 @@
res.send({ express: "Hello From Express" });
});

//app.post("/api/world", (req, res) => {
// console.log(req.body);
// res.send("You sent:" + req.body.post);
//});
app.post("/api/world", (req, res) => {
console.log(req.body);
res.send("You sent:" + req.body.post);

Check failure

Code scanning / SonarQube

Endpoints should not be vulnerable to reflected cross-site scripting (XSS) attacks

<!--SONAR_ISSUE_KEY:61beccb6-9573-4963-aa7f-67242c829f35-->Change this code to not reflect user-controlled data. <p>See more on <a href="https://nautilus.sonarqube.org/project/issues?id=SonarSource-Demos%5fjavascript-app%5fAYI8UgHPWHbe6%5f1YL8bt&branch=check-AI-detection&issues=61beccb6-9573-4963-aa7f-67242c829f35&open=61beccb6-9573-4963-aa7f-67242c829f35">SonarQube</a></p>
axios.get('https://api.example.com/data')

Check failure

Code scanning / SonarQube

URLs should not not be hardcoded

<!--SONAR_ISSUE_KEY:efd5d980-462c-456a-b8dd-9abd1795bec7-->User-specified secrets should not be disclosed. <p>See more on <a href="https://nautilus.sonarqube.org/project/issues?id=SonarSource-Demos%5fjavascript-app%5fAYI8UgHPWHbe6%5f1YL8bt&branch=check-AI-detection&issues=efd5d980-462c-456a-b8dd-9abd1795bec7&open=efd5d980-462c-456a-b8dd-9abd1795bec7">SonarQube</a></p>

Check failure

Code scanning / SonarQube

URLs should not not be hardcoded Critical

User-specified secrets should not be disclosed. See more on SonarQube
.then(response => {
const externalData = response.data;
res.send({
message: "You sent: " + req.body.post,
externalData: externalData
});
})
.catch(error => {
console.error('Error fetching external data:', error);
res.status(500).send('Error fetching external data');
});
});

app.post("/api/func", (req, res) => {
console.log(req.body);
Expand Down