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