use redis as a database using nodeJS
<p>I use 'redis' module in my app. But it's throw error. 
My code is following - </p>

<p>//app.js</p>

<pre><code>var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var redis = require('redis');

var client = redis.createClient('localhost', 3000); 
client.on('connect', function() {
    console.log("connected");
});
</code></pre>

<p>Here is the error:</p>

<pre><code>Adityas-MacBook-Air:node_elastic_redis adityagupta$ npm start 

&gt; node_elastic_redis@0.0.0 start /Users/adityagupta/Desktop/node_elastic_redis 
&gt; node ./bin/www events.js:154 throw er; // Unhandled 'error' event ^ 

Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379 
    at Object.exports._errnoException (util.js:856:11) 
    at exports._exceptionWithHostPort (util.js:879:20) 
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1057:14)
</code></pre>