var express = require('express');
var cors = require('cors');
var request = require('request');

function helloRoute() {
  var hello = new express.Router();
  hello.use(cors());


  // POST REST endpoint - query params may or may not be populated
  hello.post('/', function(req, res) {
    console.log(new Date(), 'In create route POST /');
    var url = 'http://' + process.env.FUSE_ADDRESS + '/flights';
    
		request({ url: url, method: 'POST', body: req.body , json: true }, function(error, response, body) {
      if (error) {
        res.status(500).send(error);
      } else if (response.statusCode == 200) {
        res.type('json').send(body);
      } else {
        res.status(500).send('unexpected http response code ' + response.statusCode);
      }
		});
  });

  return hello;
}

module.exports = helloRoute;


@@ -404,16 +404,740 @@
 ';%0A    %0A
+    var body = %7B%0A            %22@xmlns:BAPI_FLCUST_CREATEFROMDATA%22:%22http://sap.fusesource.org/rfc/NPL/BAPI_FLCUST_CREATEFROMDATA%22,%0A            %22@TEST_RUN%22:%22%22,%0A            %22CUSTOMER_DATA%22:%7B%0A              %22@CUSTNAME%22:%22CAMELSAP TEST%22,%0A              %22@FORM%22:%22%22,%0A              %22@STREET%22:%22From FH%22,%0A              %22@POBOX%22:%22%22,%0A              %22@POSTCODE%22:%22%22,%0A              %22@CITY%22:%22%22,%0A              %22@COUNTR%22:%22%22,%0A              %22@COUNTR_ISO%22:%22%22,%0A              %22@REGION%22:%22%22,%0A              %22@PHONE%22:%22%22,%0A              %22@EMAIL%22:%22%22,%0A              %22@CUSTTYPE%22:%22P%22,%0A              %22@DISCOUNT%22:%22000%22,%0A              %22@LANGU%22:%22%22,%0A              %22@LANGU_ISO%22:%22%22%0A            %7D,%0A            %22EXTENSION_IN%22:%5B%5D,%0A            %22RETURN%22:%5B%5D%0A          %7D%0A    %0A
 %09%09reques
@@ -1176,12 +1176,8 @@
 dy: 
-req.
 body

update file /lib/create.js