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

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -