Open nojhamster opened 9 years ago
the loader will be disabled if the path does not exist cf. https://github.com/castorjs/castor-core/blob/2.x/index.js#L166
Actually the problem is just above : the middlewares are not loaded, but an instance of castor-load is created anyway, and throws the exception. Since castor-load is not used in this case, maybe it shouldn't be created at all ?
understood. but... it may be used elsewhere, i don't know
I tried to visualize data that was previously inserted in mongo by another mean, but castor-load requires a directory and throws an exception on startup. Then I commented all lines relative to the loader in castor-core, and as far as I tested it works like a charm.
That would be sweet to be able to turn off castor-load from the config file. The documentation needs some clarification as well : in this case, collectionName is mandatory, connectionURI is very likely to be required if the db name is not "castor", and port is optional and not related to mongo.
I might propose a PR if I find some time to work on it.