title: connect ECONNREFUSED 127.0.0.1:27017'
body: <p>I have that code:</p>
  
  <pre><code>var express = require('express'),
      stylus = require('stylus'),
      logger = require('morgan'),
      bodyParser = require('body-parser'),
      mongoose = require('mongoose');
  
  var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';
  
  var app = express();
  
  function compile(str, path){
      return stylus(str).set('filename', path);
  }
  
  app.set('views', __dirname + '/server/views');
  app.set('view engine', 'jade');
  app.use(logger('dev'));
  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(stylus.middleware(
          {
              src: __dirname + '/public',
              compile: compile
          }
      ));
  app.use(express.static(__dirname + '/public'));
  
  mongoose.connect('mongodb://localhost/multivision');
  var db = mongoose.connection;
  db.on('error', console.error.bind(console, 'connection error..'));
  db.once('open', function callback(){
      console.log('multivision db opened');
  });
  
  app.get('/partials/:partialPath', function(req, res){
      res.render('partials/' + req.params.partialPath);
  });
  
  app.get('*', function(req, res) {
    res.render('index');
  });
  
  var port = 3131;
  app.listen(port);
  console.log('Listening on port ' + port + '...');
  </code></pre>
  
  <p>but when I'm trying <code>nodemon server.js</code> it throws an error:</p>
  
  <blockquote>
    <p>connection error.. { [MongoError: connect ECONNREFUSED
    127.0.0.1:27017] name: 'MongoError' message: 'connect ECONNREFUSED 127.0.0.1:27017' }</p>
  </blockquote>
  
  <p>how can I improve that? I've already installed mongoose using <code>npm install mongoose --save</code> in my directory</p>
  
  <p>Yeah there are dozens question like this but none of these helped me.. I'm new at nodejs and probably missing something</p>