Skip to content

Instantly share code, notes, and snippets.

@AdamMagaluk
Created January 30, 2015 14:57
Show Gist options
  • Save AdamMagaluk/6d5f1acfedbbce6d3455 to your computer and use it in GitHub Desktop.
Save AdamMagaluk/6d5f1acfedbbce6d3455 to your computer and use it in GitHub Desktop.
Zetta With Custom DB Locations
var util = require('util');
var zetta = require('zetta');
var DeviceRegistry = module.exports = function(path) {
zetta.DeviceRegistry.call(this, { path: path, collection: 'devices' });
};
util.inherits(DeviceRegistry, zetta.DeviceRegistry);
var util = require('util');
var zetta = require('zetta');
var PeerRegistry = module.exports = function(path) {
zetta.PeerRegistry.call(this, { path: path, collection: 'peers' });
};
util.inherits(PeerRegistry, zetta.PeerRegistry);
var zetta = require('zetta');
var DeviceRegistry = require('./device_registry');
var PeerRegistry = require('./peer_registry');
zetta({ peerRegistry: new PeerRegistry('./mypeers'), registry: new DeviceRegistry('./mydevices') })
.listen(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment