-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
41 lines (31 loc) · 966 Bytes
/
app.js
File metadata and controls
41 lines (31 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const express = require("express");
const cors = require('cors');
const app = express();
app.use(express.json());
app.use(cors());
const PORT = process.env.PORT || 3003;
app.listen(PORT, () => {
console.log("Server Listening on PORT:", PORT);
});
app.post("/report", (req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', '*');
const report = req.body;
// Process report data
// Example report data :
// {
// "handle": null,
// "safe": false,
// "siteCategory": "safe",
// "reviewText": "test report",
// "fullPath": "/dashboard",
// "reviewedProfile": null,
// "profileIds": [],
// "addresses": [],
// "socialType": "domain",
// "domain": "https://sydintel.com",
// "label": null,
// "action": "report"
// }
console.log("Got report : " + JSON.stringify(report))
return res.status(200).json({})
})