twilson63 / express-coffee

A Template for NodeJs Application using Express, CoffeeScript, Jade, Stylus, Nib
http://twilson63.github.io/express-coffee
MIT License
626 stars 152 forks source link

Mongoose default settings fail on Heroku #31

Closed Sivli-Embir closed 11 years ago

Sivli-Embir commented 11 years ago

I created a quick fix by rapping it in a try / catch so heroku can at least launch. You may want to do something more advanced so its obvious where and what is wrong. As a Rails dev I am used to SQLite just working, this had me scratching my head for a while

src/index.coffee

...

try
  mongoose.connect 'mongodb://localhost/testing'  
catch e
  console.log(e)

Also: Great Job. This pre-build let me get running really quickly.

twilson63 commented 11 years ago

Thanks for issue, we will take a look at it.

twilson63 commented 11 years ago

Just added an if check to console log if your running in production, but if your using heroku you may want to setup MongoLab or MongoHq database service and configure your db connection in the Heroku Config Vars.

Thanks

Tom