stream-node-orm icon indicating copy to clipboard operation
stream-node-orm copied to clipboard

Initiate FeedManager with a configuration object

Open avanderpluijm opened this issue 8 years ago • 0 comments

To make the module more flexible, would it be an idea to instantiate the Feedmanager with an object? Instead of a file in the application's root? In my case I have a settings file ./config/settings.js which stores all application environment variables (including the stream keys). And I have a ./config/getstream.js with:

var settings = require('./settings');
module.exports = {
  apiKey: settings.getStream.key,
  apiSecret: settings.getStream.secret,
  apiAppId: settings.getStream.appId,
  apiLocation: '',
  userFeed: 'user',
  notificationFeed: 'notification',
  newsFeeds: {
    flat: 'timeline',
    aggregated: 'timeline_aggregated'
  }
};

I then initiate the feedmanager with

var streamConfig = require('../../config/getStream');
var FeedManager = stream_node.FeedManager(streamConfig);

avanderpluijm avatar Oct 30 '17 19:10 avanderpluijm