in my app.js, i have constructed a redis client:
var redis = require('redis'),
redisClient = redis.createClient(6379, 'localhost');
...
module.exports = {
app:app,
redisClient:redisClient
}
i need to use the redis client in my other module, which is routes/index.js. here, i tried including it like so:
var redisClient = require('../app').redisClient;
unfortunatly, it is undefined. should i just require it in the index.js like i did in the app.js, and create a new instance here? or what could i change to make it work?