Skip to content
This repository has been archived by the owner on Dec 21, 2020. It is now read-only.

Optional use of castor-load ? #84

Open
nojhamster opened this issue Sep 30, 2015 · 4 comments
Open

Optional use of castor-load ? #84

nojhamster opened this issue Sep 30, 2015 · 4 comments

Comments

@nojhamster
Copy link

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.

@touv
Copy link
Contributor

touv commented Sep 30, 2015

the loader will be disabled if the path does not exist cf. https://github.com/castorjs/castor-core/blob/2.x/index.js#L166

@nojhamster
Copy link
Author

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 ?

@touv
Copy link
Contributor

touv commented Sep 30, 2015

understood. but... it may be used elsewhere, i don't know

@nojhamster
Copy link
Author

There are eventListeners binded to it here, here and here. Without those lines it seems to work fine without the loader, but I didn't perform deep testing, just clicked randomly on chart filters.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants