+
+
+/**
+ * Get package data from tic-core via RESTful API
+ * @URI /analysis
+ * @TYPE POST
+ */
+app.post('/analysis', function(req, res) {
+ var postData = JSON.stringify(req.body);
+ var addr = server.address();
+
+ var options = {
+ host: addr.address,
+ port: Config.TIC_CORE.PORT || addr.port + 1,
+ method: 'POST',
+ path: '/analysis',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Content-Length': Buffer.byteLength(postData)
+ }
+ };
+
+ var data = '';
+ var ticCoreReq = http.request(options, function (ticCoreRes) {
+ ticCoreRes.setEncoding('utf8');
+ ticCoreRes.on('data', function (chunk) {
+ data += chunk;
+ });
+ ticCoreRes.on('end', function () {
+ res.send(data);
+ });
+ });
+
+ ticCoreReq.write(postData);
+ ticCoreReq.end();
+});
+
+
+
+/**
+ * FileSystem controller (read/create)
+ * Connection with MIC