Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
388 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | function runBonjour({ port }) {
|
---|
| 4 | const bonjour = require('bonjour')();
|
---|
| 5 | const os = require('os');
|
---|
| 6 |
|
---|
| 7 | bonjour.publish({
|
---|
| 8 | name: `Webpack Dev Server ${os.hostname()}:${port}`,
|
---|
| 9 | port,
|
---|
| 10 | type: 'http',
|
---|
| 11 | subtypes: ['webpack'],
|
---|
| 12 | });
|
---|
| 13 |
|
---|
| 14 | process.on('exit', () => {
|
---|
| 15 | bonjour.unpublishAll(() => {
|
---|
| 16 | bonjour.destroy();
|
---|
| 17 | });
|
---|
| 18 | });
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | module.exports = runBonjour;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.