Hapi-MQTT
A very simple module that allows the usage of a common MQTT Client in Hapi.js
Options is an object with the arguments passed to MQTT.js
- brokerUrl: MQTT connection string (eg.
mqtt://test.mosquitto.org
) - opts: See MQTT.js for full specs
The plugin expose:
client
: The MQTT Client
Usage example:
const Hapi = ;const Boom = ; const mqttOpts = brokerUrl: 'mqtt://test.mosquitto.org' opts: username: 'myHapiService' password: 'aVerySecurePassword' ; { const server = ; await server; server; // Start server try await serverstart; catch err console; process; console;} ;