Open gilesbradshaw opened 7 years ago
Does it output anything?
no but if I change start.js to
'use strict'
var mosca = require('../../');
var config = require('./config');
var server = new mosca.Server(config);
server.on('error', function(err){
console.log(err);
});
server.on('ready', function(){
console.log('Mosca server is up and running');
});
console.log('here i am');
console.log(config)
it says..
here i am
{ id: 'mymosca',
stats: false,
logger: { level: 'debug' },
backend: { type: 'mongodb', url: 'mongodb://localhost:27017/mosca' },
persistence:
{ factory: { [Function: MongoPersistence] super_: [Object] },
url: 'mongodb://localhost:27017/mosca' } }
so it is definitely running the code but node isn't waiting for the event emitters to fire..
Ok here we go -
you have
var server = new mosca.Server(config);
but if I do..
var server = new mosca.Server(config, function() {
console.log('Mosca server is up and running')
});
it doesn't exit straight away..
that function might contain an error as first argument
I am trying to run mongodb example with
but it just exists straight away..