diff --git a/server.js b/server.js index d93dbdb..f778afb 100644 --- a/server.js +++ b/server.js @@ -15,6 +15,24 @@ app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(cors(corsOptions)); +function callInitFileMover() { + var options = { + host: url, + port: 80, + path: 'https://natnats.mobilous.com/iniFileMover', + method: 'GET' + }; + + http.request(options, function(res) { + console.log('STATUS: ' + res.statusCode); + console.log('HEADERS: ' + JSON.stringify(res.headers)); + res.setEncoding('utf8'); + res.on('data', function (chunk) { + console.log('BODY: ' + chunk); + }); + }).end(); +} + var storage = multer.diskStorage({ destination: function(req, file, cb) { cb(null, '/var/www/html/FBS') @@ -38,6 +56,7 @@ app.post('/upload', function(req, res, next) { else { var FileName = req.file.filename; res.status(200).send(FileName); + callInitFileMover(); } //return res.status(200).send(req.file)