Created
May 13, 2014 21:37
-
-
Save henryboldi/1aea284619b2d15eeea9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(process.env.NODE_ENV); | |
if (process.env.NODE_ENV === 'development') { db_connection = { | |
module : 'sails-mongo', | |
url: process.env.DB_URL, | |
schema: true | |
}} else if (process.env.NODE_ENV === 'production'){ db_connection = { | |
module: 'sails-mongo', | |
url: 'mongodb://blop:[email protected]:10479/hackerbracket', | |
schema: true | |
}} else { db_connection = { | |
module : 'sails-mongo', | |
url: process.env.DB_URL, | |
schema: true | |
}} | |
module.exports = { db: db_connection }; | |
In terminal: | |
13 May 16:35:46 - [nodemon] restarting due to changes... | |
13 May 16:35:46 - [nodemon] starting `node app.js` | |
undefined | |
undefined | |
error: One of your models (Comment) doesn't have a connection. | |
error: Do you have a default `connection` in your `config/models.js` file? | |
13 May 16:35:48 - [nodemon] app crashed - waiting for file changes before starting... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment