adds timestamp to logged packet
This commit is contained in:
parent
205f88bb19
commit
c6a24ce39c
1 changed files with 1 additions and 0 deletions
1
index.js
1
index.js
|
|
@ -28,6 +28,7 @@ var mqtt = new mosca.Server({
|
|||
|
||||
mqtt.on('published', function(packet, client) {
|
||||
packet.payload = packet.payload.toString();
|
||||
packet.timestamp = new Date();
|
||||
db.insert(packet);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue