Mongoose (node.js), failed to connect to [localhost:27017] -
i'm trying start server, getting error:
error: failed connect [localhost:27017] @ null.<anonymous> (c:\node\project\node_modules\mongoose\node_modules\mong odb\lib\mongodb\connection\server.js:549:74) @ emit (events.js:106:17) @ null.<anonymous> (c:\node\project\node_modules\mongoose\node_modules\mong odb\lib\mongodb\connection\connection_pool.js:150:15) @ emit (events.js:98:17) @ socket.<anonymous> (c:\node\project\node_modules\mongoose\node_modules\mo ngodb\lib\mongodb\connection\connection.js:533:10) @ socket.emit (events.js:95:17) @ net.js:440:14 @ process._tickcallback (node.js:419:13)
here code:
var debug = require('debug')('project'); var app = require('../app'); app.set('port', process.env.port || 3000); var server = app.listen(app.get('port'), function() { debug('express server listening on port ' + server.address().port); });
when using "npm start" - server getting second, literally after going down..
make sure server started running mongod
command line.
Comments
Post a Comment