Skip to content

Commit

Permalink
fix(server): throws if options.paths is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Aug 27, 2016
1 parent 3f6009d commit 1f561df
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/index.js
Expand Up @@ -24,6 +24,19 @@ function register (server, options, next) {
log.info('config', 'Storing all data in memory only')
} else {
PouchDB.plugin(require('pouchdb-adapter-leveldb'))

// 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'
}

options.db.prefix = path.join(options.paths.data, 'data' + path.sep)
log.info('config', 'No CouchDB URL provided, falling back to PouchDB')
log.info('config', 'Writing PouchDB database files to ' + options.db.prefix)
Expand Down

0 comments on commit 1f561df

Please sign in to comment.