forked from libp2p/js-libp2p-webrtc-star
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aegir.js
50 lines (41 loc) · 883 Bytes
/
.aegir.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
let firstRun = true
let sigServers = []
async function boot () {
const options1 = {
port: 15555,
host: '127.0.0.1',
metrics: firstRun
}
const options2 = {
port: 15556,
host: '127.0.0.1',
metrics: false
}
const options3 = {
port: 15557,
host: '127.0.0.1',
metrics: false
}
if (firstRun) {
firstRun = false
}
const { sigServer } = await import('./dist/src/index.js')
sigServers.push(await sigServer(options1))
sigServers.push(await sigServer(options2))
sigServers.push(await sigServer(options3))
console.log('signalling on:')
sigServers.forEach((sig) => console.log(sig.info.uri))
}
async function stop () {
await Promise.all(sigServers.map(s => s.stop()))
}
/** @type {import('aegir').PartialOptions} */
export default {
test: {
before: boot,
after: stop
},
build: {
bundle: false
}
}