-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
38 lines (28 loc) · 846 Bytes
/
app.js
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
const express = require('express')
var app = module.exports = express();
app.use(express.json());
console.log("Start....")
app.post( '/case', function ( req, res) {
console.log(JSON.stringify(req.body))
res = res.status(200);
res = res.type('application/json');
let beforeImage = req.body.beforeImage
let data = req.body.currentImage
data.extensions = data.extensions || {}
if (data.serviceTeam &&
beforeImage.serviceTeam &&
data.serviceTeam.id != beforeImage.serviceTeam.id) {
console.log("Team changed")
delete data.processor
}
console.log(data)
let body = {
data: data
}
console.log(JSON.stringify(body))
res.send(body);
})
if (!module.parent) {
app.listen( process.env.PORT || 4000)
console.log('Express started....');
}