Updates
This commit is contained in:
@@ -34,6 +34,7 @@ await mod.close()
|
||||
- [../_shared/PRODUCTION.md](../../_shared/PRODUCTION.md) — production checklist
|
||||
- [../_shared/DOC_STANDARDS.md](../../_shared/DOC_STANDARDS.md) — documentation standards
|
||||
|
||||
- [examples/basic.js](examples/basic.js)
|
||||
- Integration: [`../../real_tests/integration/`](../../../real_tests/integration/) — `intent-router-two-node.js`
|
||||
|
||||
## Test
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
require('bare-process/global')
|
||||
const HyperP2PIntentRouter = require('../index.js')
|
||||
|
||||
async function main () {
|
||||
const router = new HyperP2PIntentRouter({ enableBackgroundTimers: false })
|
||||
await router.ready()
|
||||
await router.registerIntent({
|
||||
id: 'echo-1',
|
||||
capabilities: ['echo'],
|
||||
description: 'echo demo service',
|
||||
topics: ['demo']
|
||||
})
|
||||
const matches = await router.resolveIntent({ capabilities: ['echo'] })
|
||||
console.log('[intent-router]', matches.length, 'match(es)', router.getLocalIntents().length, 'local')
|
||||
await router.close()
|
||||
}
|
||||
main().catch(console.error)
|
||||
Reference in New Issue
Block a user