hoodiehq / ember-hoodie

Build awesome offline-first Ember apps with Hoodie!
MIT License
17 stars 6 forks source link

v2.3.0 doesnt allow me to configure server options any more #63

Closed brunopedroso closed 7 years ago

brunopedroso commented 7 years ago

up to 2.2.x, index.js allowed to pass 'embeded' hoodie server options through my environment.js. (https://github.com/hoodiehq/ember-hoodie/blob/v2.2.3/index.js#L34)

but in 2.3.0 it has been wrongly adapted to new hoodie. (https://github.com/hoodiehq/ember-hoodie/commit/67fb969c7dd3793fa5c4513d360e30251c891cb1#diff-168726dbe96b3ce427e7fedce31bb0bcL34).

I guess a better approach would be to keep index.js as it was (as the first link above), passing the whole options to hapi's server.register and update README to guide users to use new hoodie style config, just like:

// config/environment.js

var PouchDB = require('pouchdb');

if (environment === 'development') {
  ENV.hoodie = {
    client: {
      url: 'http://localhost:4201'
    },
    server: {
      PouchDB: PouchDB
      adminPassword: 'secret',
      port: 4201
    }
  }
}