Reputation: 8376
I'd like to use redis connections for my sails application but I dont want to use sail-redis as I won't bind it to any model.
So I identify what steps I should follow.
Then I get quite confused as I don't really know how to expose any object globally and, in case I need it, prepare functions using redis and binding to any custom service.
How can I achieve it?
Upvotes: 1
Views: 580
Reputation: 3993
You could attach your Redis adapter to the sails object in the bootstrap
// config/bootstrap.js
sails.redis = your_redis_adapter
The sails object being accessible globally, you will be able to access to the redis adapter from any point of your application too.
Upvotes: 1