Skip to content

Commit

Permalink
fix(server): Resolve issue with unset paths object
Browse files Browse the repository at this point in the history
Resolve the issue brought to light after merging #627, whereby the
paths.public key is not set for the server if you are specifying a
DB url.
  • Loading branch information
minrwhite authored and gr2m committed Nov 10, 2016
1 parent 047a8ff commit b4a1229
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ function register (server, options, next) {
if (!options.db) {
options.db = {}
}
if (!options.paths) {
options.paths = {
public: 'public'
}
}

// mapreduce is required for `db.query()`
PouchDB.plugin(require('pouchdb-mapreduce'))
Expand All @@ -32,12 +37,6 @@ function register (server, options, next) {

// this is a temporary workaround until we replace options.db with options.PouchDB:
// https://github.com/hoodiehq/hoodie/issues/555
if (!options.paths) {
options.paths = {
data: '.hoodie',
public: 'public'
}
}
if (!options.paths.data) {
options.paths.data = '.hoodie'
}
Expand Down

0 comments on commit b4a1229

Please sign in to comment.