
var request = require('request');
var _ = require('lodash');

var host = 'http://localhost:3000';


var visualizationTypes = [
    {
        name: 'line'   
    }, {
        name: 'scatter'   
    }, {
        name: 'roi',
        initialDataField: 'points'
    }, {
        name: 'roi-image',
        initialDataField: 'points'   
    }, {
        name: 'image'
    }, {
        name: 'gallery'   
    }, {
        name: 'volume'   
    }
];

console.log('updating visualization types');

_.each(visualizationTypes, function(type) {
    var options = {
      uri: host + '/visualizations/types',
      method: 'POST',
      json: type
    };

    request(options, function (error, response) {
        if (!error && response.statusCode == 200) {
            console.log('Successfully added type ' + type.name);
        }
    });
});


@@ -56,16 +56,56 @@
 ash');%0A%0A
+%0Avar port = process.env.PORT %7C%7C '3000';%0A
 var host
@@ -128,14 +128,22 @@
 host
-:3000'
+' + ':' + port
 ;%0A%0A%0A

fix port in creating visualization types