const _ = require('lodash');
const promisify = require('promisify-node');

const scan = promisify(require('../../core/workers/dateRangeScan/parent'));

// starts a scan
// requires a post body with configuration of:
// 
// - config.watch
const route = function *() {

  var config = require('./baseBacktestConfig');

  var body = JSON.parse(this.request.body.data);

  _.merge(config, body);

  config.debug = false;

  this.body = yield scan(config);
};

module.exports = route;
@@ -316,104 +316,42 @@
 %0A%0A  
-var body = JSON.parse(this.request.body.data);%0A%0A  _.merge(config, body);%0A%0A  config.debug = false
+_.merge(config, this.request.body)
 ;%0A%0A 

update range scane route