Skip to content

Commit

Permalink
Added examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mdidon committed Mar 18, 2021
1 parent 47e867b commit 37184ea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/simple.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { Bonjour } = require('../dist')

const service = new Bonjour()

service.publish({ name: 'My Web Server', type: 'http', port: 3000 })

let browser = service.find({ type: 'http' })

browser.on('up', (service) => {
console.log('up', service)
})

browser.on('down', (service) => {
console.log('down', service)
})

0 comments on commit 37184ea

Please sign in to comment.