octoblu / meshblu

Meshblu is a cross-protocol IoT machine-to-machine messaging system.
https://meshblu.readme.io/
MIT License
816 stars 181 forks source link

Is the config.js necessary in coapServer? #108

Closed tankerdream closed 8 years ago

tankerdream commented 8 years ago

server.js is

require('coffee-script/register');

process.stdout.write('Starting CoAP...');
var coapServer = require('./lib/coapServer')();
console.log(' done.');

When I run it,commend line is

/meshblu-master/lib/coapServer.js:33
      coapConfig = config.coap || {};
                         ^

TypeError: Cannot read property 'coap' of undefined

I think there is something wrong in coapServer.js line 33 coapConfig = config.coap || {};

iamruinous commented 8 years ago

The config is passed in by server.js

if (program.coap) {
  process.stdout.write('Starting CoAP...');
  var coapServer = require('./lib/coapServer')(config, parentConnection);
  console.log(' done.');
}
tankerdream commented 8 years ago

I see.The parameter config is necessary ,but the coap in the config is optional.thx!