You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import Connector from './connector.js'
|
|
|
|
import AppsStore from './stores/apps.js'
|
|
|
|
|
|
|
|
import AppsHandler from './handlers/apps.js'
|
|
|
|
|
|
|
|
// create handlers
|
|
|
|
const appsHandler = new AppsHandler
|
|
|
|
|
|
|
|
// create connector and add handlers for events
|
|
|
|
const connector = new Connector({
|
|
|
|
'pouchdb.apps.create': appsHandler.create,
|
|
|
|
'pouchdb.apps.update': appsHandler.update,
|
|
|
|
'pouchdb.apps.findOne': appsHandler.findOne,
|
|
|
|
'pouchdb.apps.find': appsHandler.find
|
|
|
|
})
|
|
|
|
|
|
|
|
//
|
|
|
|
connector.client.onerror = function() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
connector.client.onopen = function() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
connector.client.onclose = function() {
|
|
|
|
process.exit()
|
|
|
|
}
|