javascript - make redis client available in route -


in app.js, have constructed redis client:

var redis = require('redis'),   redisclient = redis.createclient(6379, 'localhost');  ...  module.exports = {   app:app,   redisclient:redisclient } 

i need use redis client in other module, routes/index.js. here, tried including so:

var redisclient = require('../app').redisclient; 

unfortunatly, undefined. should require in index.js did in app.js, , create new instance here? or change make work?


Comments

Popular posts from this blog

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

clojure - 'get' replacement that throws exception on not found? -