gr2m / spawn-pouchdb-server

Configurable per-app pouchdb-server as a drop-in replacement for CouchDB
27 stars 13 forks source link

Shutting down the server #14

Closed jo closed 9 years ago

jo commented 9 years ago

It would be nice to be able to cleanly shut down the server, eg by exposing a server.stop method, similar to hapi:

spawnPouchdbServer(options, function(error, server) {
  // ... finally:
  server.stop(function(error) {
    // server has been shut down
  })
})
jo commented 9 years ago

As I just discovered, an object with a kill method is handed over to the callback.

So we might just want to document this.

gr2m commented 9 years ago

one thought: wouldn't a reset method without killing the server be better?

jo commented 9 years ago

I like the idea! But we need a stop method anyway.

gr2m commented 9 years ago

agree, let's do it

jo commented 9 years ago

Its all there: https://github.com/hoodiehq/spawn-pouchdb-server/pull/16

gr2m commented 9 years ago

released as spawn-pouchdb-server@3.2.0