SailsJS deployment to Heroku, connect to Mongolabs MongoDB -


i right attempting first heroku deployment of sailsjs api. app uses sailsjs v0.11 andsails-mongo 0.11.2.

i have updated config/connections.js include connection information mongodb database have hosted free @ mongolab.

mongodb: {     adapter: 'sails-mongo',     url: "mongodb://db-user:password123@ds047812.mongolab.com:47812/testing-db" } 

also updated config/models.js point adapter.

module.exports.models = {     connection: 'mongodb',     migrate: 'safe' }; 

this have changed running code locally, when deploy heroku app crashes , error...

/home/zacharyhustles/smallchangeapi/node_modules/connect-mongo/lib/connect-mongo.js:186       throw err;             ^ @ socket.emit (events.js:107:17) 2015-07-08t19:37:00.778316+00:00 app[web.1]:      @ socket.<anonymous> (/app/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10) error: error connecting database: failed connect [localhost:27017] 

how rid of this, , make sure sails not try connecting localhost db?

ok, problem storing sessions.

my solution setup redis database store sessions.

in config/sessions.js make sure commented out except method want session store.

mine looked this:

adapter: 'redis', host: 'example.redistogo.com', port: 1111, db: '/redistogo', pass: 'xxxxxyyyyyyxyxyxyyx', 

this solved posted problem, hope helps person out.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -