mcollina / mqtt-level-store

Store your in-flight MQTT message on Level, for Node
MIT License
24 stars 11 forks source link

how to use in browser #5

Closed kiralikbeyin closed 8 years ago

kiralikbeyin commented 8 years ago
var manager = '/a.json';
    client = mqtt.connect('ws://localhost:3000', {
            username: logid
            , password: logpass
            , incomingStore: manager.incoming
            , outgoingStore: manager.outgoing
             ,keepalive : 0
          });

mqtt.Store();

I tried this code in a html file but no action in a.json file

Is there any example please?

mcollina commented 8 years ago

It should work as in the example: https://github.com/mcollina/mqtt-level-store/blob/master/example.js. Your code above is not passing the instances to the mqtt client..

kiralikbeyin commented 8 years ago

I tried it using directly in html javascript. Is there any example of JavaScript?

It should work as in the example: https://github.com/mcollina/mqtt-level-store/blob/master/example.js. Your code above is not passing the instances to the mqtt client..

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mcollina commented 8 years ago

You need to use browserify of webpack to bundle mqtt-level-store with mqtt and levelup.