I'm not sure I understand how to configure the gunDB servers in the constructor. This is what I'm trying to do:
var gunOptions = {
file: 'data.json',
peers: ['host1.com','host2.com']
}
bucket = new gun(gunOptions);
When I do this I get lots of errors that look like this:
Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:346:11) at ServerResponse.writeHead (_http_server.js:180:21) at success (/home/ubuntu/lib/ls/start.ls:88:7) at Gun. (/home/ubuntu/lib/ls/start.ls:204:7) at wcb (/home/ubuntu/node_modules/gun/gun.js:640:18) at /home/ubuntu/node_modules/gun/lib/wsp.js:247:7 at r.ws.cbs.(anonymous function) (/home/ubuntu/node_modules/gun/gun.js:1387:6) at WebSocket.ws.onmessage (/home/ubuntu/node_modules/gun/gun.js:1417:86) at WebSocket.onMessage (/home/ubuntu/node_modules/ws/lib/WebSocket.js:418:14) at emitTwo (events.js:106:13)
However... When I initialize gun like this it works great:
bucket = new gun(['host1.com','host2.com']);
Can anyone see what I'm doing wrong?
Thanks in advance. ☺