1
0
mirror of https://github.com/sbender9/signalk-raymarine-autopilot.git synced 2020-11-18 19:37:28 -08:00

user plugin.registerWithRouter

This commit is contained in:
Scott Bender 2016-11-15 10:57:19 -05:00
parent 5edb73277f
commit 7e548e33a3

View File

@ -51,9 +51,11 @@ module.exports = function(app) {
debug("started") debug("started")
}; };
plugin.executeCommand = function(json) { plugin.registerWithRouter = function(router) {
debug("executeCommand: " + util.inspect(json, {showHidden: false, depth: null})) router.post("/command", (req, res) => {
sendCommand(app, deviceid, json) sendCommand(app, deviceid, req.body)
res.send("Executed command for plugin " + plugin.id)
})
} }
plugin.stop = function() { plugin.stop = function() {