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
Post a Comment