Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store.open doesn't find the store #24

Open
kevinmerckx opened this issue Oct 12, 2017 · 1 comment
Open

Store.open doesn't find the store #24

kevinmerckx opened this issue Oct 12, 2017 · 1 comment

Comments

@kevinmerckx
Copy link

Hi Hoodie team,

I've manually set up Hoodie with a Node script.

const Hapi = require('hapi');
const hoodie = require('hoodie').register;
const PouchDB = require('pouchdb-core')
  .plugin(require('pouchdb-find'))
  .plugin(require('pouchdb-replication'))
  .plugin(require('pouchdb-mapreduce'))
  .plugin(require('pouchdb-adapter-fs'))
  .defaults({
    prefix: '.hoodie/data/'
  });
const Store = require('@hoodie/store-server-api')(PouchDB)
  
const server = new Hapi.Server()
server.connection({
  host: 'localhost',
  port: 8080
});

server.register({
  register: hoodie,
  options: { // pass options here
    inMemory: false,
    public: 'dist',
    PouchDB: PouchDB
  }
}, function (error) {
  if (error) {
    throw error
  }

  server.start(function (error) {
    if (error) {
      throw error
    }

    console.log('Server running at:', server.info.uri);
    // HERE I want to do some task with the users' stores
    Store.open('userXXXYYYZZ'); // DOES NOT WORK

  })
});

Everything's fine client side. I'd like to work on the databases to replicate data and do some server side tasks. I tried to open a user's store given its id but it always fails with Missing: Store does not exist. I use the fs adapter and I do see the files! Is there something I'm missing?

@gr2m
Copy link
Member

gr2m commented Oct 14, 2017

Could you create a test repository which would allow us to replicate the problem? That would be very helpful

What is userXXXYYYZZ in your example above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants