-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
24 lines (20 loc) · 716 Bytes
/
example.js
File metadata and controls
24 lines (20 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const hyperdrive = require('hyperdrive')
const replicate = require('hypercore-replicate')
const WebSocket = require('simple-websocket')
const packager = require('./')
const storage = require('dat-storage')
const rimraf = require('rimraf')
const node = packager({
discovery: {
key: '3546e77a133f01721058fb96cd9034d2cbf1e665eb040455e6eec614a8206bb7',
secretKey: 'a35a819166448913b81a0ab862573f4179ebb8d4bc2e871a600d80281355d7453546e77a133f01721058fb96cd9034d2cbf1e665eb040455e6eec614a8206bb7'
}
})
node.listen(parseInt(process.env.PORT || 3000), onlistening)
function onlistening(err) {
if (err) {
console.error('ERR', err)
process.exit(1)
}
console.log('Listening on', node.address())
}