()
| 104 | } |
| 105 | |
| 106 | function runServer() { |
| 107 | const thing = makeThing(); |
| 108 | |
| 109 | // If adding more than one thing, use MultipleThings() with a name. |
| 110 | // In the single thing case, the thing's name will be broadcast. |
| 111 | const server = new WebThingServer(new SingleThing(thing), 8888); |
| 112 | |
| 113 | process.on('SIGINT', () => { |
| 114 | server.stop().then(() => process.exit()).catch(() => process.exit()); |
| 115 | }); |
| 116 | |
| 117 | server.start().catch(console.error); |
| 118 | } |
| 119 | |
| 120 | runServer(); |
no test coverage detected