Commit 0e3f256a by Chavee Issariyapat

Merge branch 'alpha-test' of https://dev.nexpie.com/stack/vernemq into alpha-test

parents 98aeda43 9547c678
......@@ -3,7 +3,7 @@ function on_delivery(req, res, next) {
var response = {
'result': 'ok',
'modifiers': {
"topic": topics
"topic": topics
}
}
res.send(response)
......
function getTopic(topic, id) {
var _topic = classifiedTopic(topic) + '/!' + id + topic.split(classifiedTopic(topic))[1]
return _topic
if (!checkWildCard(topic)) {
var _topic = classifiedTopic(topic) + '/!' + id + topic.split(classifiedTopic(topic))[1]
return _topic
}
else return topic
}
module.exports.getTopic = getTopic
......@@ -16,4 +19,9 @@ function classifiedTopic(topic) {
} else if (topic.indexOf('@client') !== -1) {
return '@client'
}
}
function checkWildCard(topic) {
if (topic.indexOf('#') > -1) return true
else return false
}
\ No newline at end of file
......@@ -814,6 +814,9 @@ vmq_webhooks.webhook3.endpoint = http://localhost:40000/authpub
vmq_webhooks.webhook4.hook = on_publish
vmq_webhooks.webhook4.endpoint = http://localhost:41000/onpub
vmq_webhooks.webhook5.hook = on_delivery
vmq_webhooks.webhook5.endpoint = http://localhost:40000/ondelivery
## Specify the address and port of the bridge to connect to. Several
## bridges can configured by using different bridge names (e.g. br0). If the
## connection supports SSL encryption bridge.ssl.<name> can be used.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment