-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database config does not work for environments #16
Comments
@sschimmel just tested on local env. Did you run app with |
Check to see if I have a database.js file and indeed in node_modules/trailpack-mongoose/config is a file named database.js. I'm on the most recent trailpack-mongoose (0.4.1). Application is started with NODE_ENV=testing. In node_modules/trailpack-mongoose/config/database.js I only see models being exported. Is it possible to add a store there? That's what I've done in the env config. |
Defining a second store in config/database.js doesn't work either. Trails then tries to connect to both stores of which one fails as that config isn't valid for the environment we're in. |
@sschimmel Could you please show your app somehow ? |
What parts are you interested in? I can make a gist of those files. |
@sschimmel Could you please try to run my sample from here: Just run |
Both work however the testing environment is also using the test3 database from development and not the temp database as is specified in the configuration file.
|
@sschimmel ok. Thank you. Will look into this again. With updated node version. |
Issue Description
I have a default config in config/database.js and a different config in config/env/testing.js. When I set the environment to testing the database configuration from testing.js is not used. When I remove the stores and models objects from database.js trails just does not detect any database configuration.
database.js:
testing.js:
Environment
Manually updated to 1.0.4 as npm did not detect it, didn't help to solve the issue. The ORM I use is mongoose with version 0.4.1. of trailpack-mongoose.
@sschimmel +
The text was updated successfully, but these errors were encountered: